简体   繁体   English

通过PHP连接ftp

[英]Connect Ftp Via PHP

I have to connect to moteng site ftp. 我必须连接到moteng站点ftp。 I have tried with below code but i'm not getting connected. 我已经尝试使用下面的代码,但是我没有连接。

$ftp_server="ftp://dropbox.moteng.com/";
$ftp_user_name="xxxx";
$ftp_pass="xxxx";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_pass);

Here login result is null. 登录结果为空。

But same login details working in browser. 但相同的登录详细信息可在浏览器中使用。

Please help to complete this task. 请帮助完成此任务。 thanks 谢谢

Directly from the manual: 直接来自手册:

The FTP server address. This parameter shouldn't have any trailing slashes and shouldn't be prefixed with ftp://.

You made both mistakes, having a trailing slash, and prefixing it with ftp:// 您犯了两个错误,都在斜杠后面加上了ftp://前缀

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM