Home  >  Article  >  Backend Development  >  PHP web page ftp code three create directory_PHP tutorial

PHP web page ftp code three create directory_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:05:531228browse

php web page ftp code three create directory

$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 "";
exit;
}else{
echo "<script>alert('Folder created Failed');history.back();</script>";
exit;
}

}else{
echo "<script>alert('Folder cannot be Is empty');history.back();</script>";
exit;
}
?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445067.htmlTechArticlephp web page ftp code three to create a directory?php $ftpserver=$_POST[ftpserver]; $ftpport=$_POST[ ftpport]; $ftpuser=$_POST[ftpuser]; $ftppassword=$_POST[ftppassword]; $ftp=@ftp_connect($ftp...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn