PHP web page ftp code three create directory_PHP tutorial

WBOY
Release: 2016-07-20 11:05:53
Original
1266 people have browsed it

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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template