$ftpserver=$_POST[ftpserver];
$ftpport=$_POST[ftpport];
$ftpuser= $_POST[ftpuser];
$ftppassword=$_POST[ftppassword];
$ftp=@ftp_connect($ftpserver,$ftpport);
if(!$ftp){ echo "Connect to FTP server" .$ftpserver."port".$ftpport."failed";exit;}
$rs=@ftp_login($ftp,$ftpuser,$ftppassword);
if(!$rs){ echo " Incorrect username or password, failed to connect to the FTP server";exit;}
$curDir=stripslashes($_POST[curDir]);
$dirname=stripslashes($_POST[name]);
if($dirname)
{
if($curDir=="/")
{
$dirpath=$curDir.$dirname;
}else{
$dirpath =$curDir."/".$dirname;
}
$rs=ftp_mkdir($ftp,$dirpath);
if($rs)
{
echo "