Jump to content

ftp in a browser


richiec

Recommended Posts

Hey there, I'm trying to set up a little ftp script to make it easier to upload files and add new folders for images and videos ect on a backend admin page however the following script just will not connect I keep getting the "Couldn't connect to 66.40.52.167" error so it's not even finding the server however when I put it into my browser it connects just fine, I've even pinged it and all works fine so I don't get it.

 

$ftp_server = "66.40.52.167";
$ftp_user = "username";
$ftp_pass = "password";

$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 

if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
    echo "Connected as $ftp_user@$ftp_server\n";
} else {
    echo "Couldn't connect as $ftp_user\n";
}


ftp_close($conn_id);  

 

Any ideas would be appreciated!

Link to comment
https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/
Share on other sites

this i can see the browser, but not the http for that ip

ftp://66.40.52.167";

 

i see the manual states can not start with ftp://

 

anyway, i tried your code and got the can't find a username, so it must have tried to connect at least

 

Link to comment
https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294393
Share on other sites

Thanks for the responces! I don't really want to use a direct ftp link with the username and password in it I would rather it be an actual script for a file manager just like the script you posted the link too.

 

I checked the script out and filled out all of the settings, not using the ip either using the actual url of ftp.freehostia.com and I'm still having an issue, it's still saying that it can't connect to ftp.freehostia.com. Is there something in the php.ini file that I would have to change/add to allow a filemanager ftp connection that's the only thing I can think of now with this script saying the same thing.

Link to comment
https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294457
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.