$ftpserver=$_post[ftpserver];
$ftpport=$_post[ftpport];
$ftpuser=$_post[ftpuser];
$ftppassword=$_post[ftppassword];
$ftp=@ftp_connect($ftpserver,$ftpport);
if(!$ftp){ echo "连接ftp服务器".$ftpserver."的端口".$ftpport."失败";exit;}
$rs=@ftp_login($ftp,$ftpuser,$ftppassword);
if(!$rs){ echo "用户名或密码错误,连接ftp服务器失败";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 "<script>alert('创建文件夹成功');history.back();</script>";
exit;
}else{
echo "<script>alert('创建文件夹失败');history.back();</script>";
exit;
}
}else{
echo "<script>alert('文件夹不能为空');history.back();</script>";
exit;
}
?>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号