richiec Posted December 4, 2011 Share Posted December 4, 2011 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! Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/ Share on other sites More sharing options...
QuickOldCar Posted December 4, 2011 Share Posted December 4, 2011 That ip 66.40.52.167 is dead test it http://www.selfseo.com/ping_test.php Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294387 Share on other sites More sharing options...
QuickOldCar Posted December 4, 2011 Share Posted December 4, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294393 Share on other sites More sharing options...
QuickOldCar Posted December 4, 2011 Share Posted December 4, 2011 ftp://username:password@66.40.52.167 replace your username and password, try it oddly the forum removes the colon from the link and also adds http:// to the front for urls ftp://username:password@66.40.52.167 Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294395 Share on other sites More sharing options...
QuickOldCar Posted December 4, 2011 Share Posted December 4, 2011 Here's neat script for doing as you want, can even preview images, play mp3's and a search http://www.gerd-tentler.de/tools/filemanager/ Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294407 Share on other sites More sharing options...
richiec Posted December 5, 2011 Author Share Posted December 5, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294457 Share on other sites More sharing options...
richiec Posted December 5, 2011 Author Share Posted December 5, 2011 Well I contacted my host support since I couldn't understand why it wasn't working and they pretty much said they don't offer the ability for 3rd party file manager scripts lol, so guess that explains why I was having issues - sigh. Quote Link to comment https://forums.phpfreaks.com/topic/252460-ftp-in-a-browser/#findComment-1294467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.