PHP page FTP code two file upload
$ftpserver =$_post[ftpserver];
$ftpport =$_post[ftpport];
$ftpuser =$_post[ftpuser];
$ftppassword =$_post[ftppassword];
$ftp = @ftp_connect ($ftpserver, $ftpport);
if (! $ftp) {echo "connects to FTP Server". $ftpserver. " The port ". $ftpport." To fail "; exit;}
$rs = @ftp_login ($ftp, $ftpuser, $ftppassword);
if (! $rs) {echo "username or password error, connection to FTP server failed"; exit;}
$curDir =stripslashes ($_post[curdir]);
$localfile =str_replace ("\", "/", Stripslashes ($_post[file1]));
if ($localfile)
{
$filename =substr (STRRCHR ($localfile, "/"), 1);
if ($curDir = = "/")
{
$remotefile = $curDir. $filename;
}else{
$remotefile = $curDir. " /". $filename;
}
$rs =ftp_put ($ftp, $remotefile, $localfile, FTP_ASCII);
if ($RS)
{
echo "";
Exit
}else{
echo "";
Exit
}
}else{
echo "";
Exit
}
?>
http://www.bkjia.com/PHPjc/445066.html www.bkjia.com true http://www.bkjia.com/PHPjc/445066.html techarticle PHP page FTP code two file upload? php $ftpserver =$_post[ftpserver]; $ftpport =$_post[ftpport]; $ftpuser =$_post[ftpuser]; $ Ftppassword=$_post[ftppassword]; $ftp = @ftp_connect ($ftp ...