琼筱
新手上路

UID 102355
精华
0
积分 8
帖子 6
金钱 8 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2007-11-29 来自 北京
状态 离线
|
基础问题 ftp_login() expects parameter 1 to be resource, on line 39?
$ftp = array("host"=>"192.168.0.114","port"=>21);;
$ftp = new FTP($ftp["host"],$ftp["port"],$username,$password);
function FTP($host = "", $port = 21, $username = "", $password = "", $conn = null)
{
$this->host = $host;
$this->username = $username;
$this->password = $password;
$this->port = $port;
if($conn == null)
{
此行有误 $this->conn = ftp_connect($this->host, $this->port, 30);
39行: $result = ftp_login($this->conn, $this->username, $this->password);
if ((!$this->conn) || (!$result) ) { //导致判断有误,连接失败!
ini_set("display_errors","On");
echo error_reporting(E_ALL);
die("服务器连接失败!");
}
else
return true;
}
else
{
$this->conn = $conn;
}
}
请各位给一个详细的回答,错误的地方
|  Do super php |
|