Boozman Posted October 12, 2009 Share Posted October 12, 2009 Ok.I own a server with the online game San Andreas Multiplayer.i am trying to make a PHP script to show the ban database.its suppost to retrieve the ban file from the FTP but i keep getting this error. Fatal error: Call to undefined function ftp_connect() in /hosted/subs/ulmb.com/g/a/gangwardm/public_html/ban.php on line 10 here is the code im using: <?php //GetBans //October 11th/2009 //Retrieves the samp banlist from your server and echos it back in a neat fashion. $ftp_host = "-myhostname-"; //put the ip / hostname to your ftp here $ftp_user = "-myusername"; //put your login here $ftp_pass = "-mypassword-"; //put your password here $banfile = "samp.ban"; $con = ftp_connect($ftp_host) or die("Couldnt connect to your ftp (check your settings!"); ftp_login($con, $ftp_user, $ftp_pass); ftp_get($con, "ban.txt", $banfile, FTP_ASCII); ftp_close($con); $file = fopen("ban.txt", "r"); $bans = fread($file, filesize("ban.txt")); fclose($file); echo nl2br($bans);?> Please help i need this fixed.Thanks,Boozmanp.s. i put in the right FTP info, because i took the info i put in and pasted it into filezilla and it connected. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 12, 2009 Share Posted October 12, 2009 It sounds like your server has the ftp_connect function disabled. Link to comment Share on other sites More sharing options...
Boozman Posted October 12, 2009 Author Share Posted October 12, 2009 well maybe, but i tried it on 3 other host and it didnt work.is there a way to enable it? Link to comment Share on other sites More sharing options...
Synook Posted October 12, 2009 Share Posted October 12, 2009 This makes it sound like an optional extension: In order to use FTP functions with your PHP configuration, you should add the --enable-ftp option when installing PHP.You could ask the host kindly to see whether they could enable it Link to comment Share on other sites More sharing options...
Boozman Posted October 12, 2009 Author Share Posted October 12, 2009 this is true.so this is definitely the problem then? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 12, 2009 Share Posted October 12, 2009 The problem is that the ftp_connect function is not defined. That's either because they didn't compile PHP with those functions, or because they explicitly disabled those functions after installing. Link to comment Share on other sites More sharing options...
Boozman Posted October 12, 2009 Author Share Posted October 12, 2009 oh ok thank you for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.