Jump to content

Need Help. Call To Undefined Function Ftp_connect()


Boozman
 Share

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...