I need to automate some file transfers between two sites. I just tried the script below to see if I could connect and got nothing. Then I found out that my hosting (ATT/Yahoo) does not support the standard ftp functions of php.
Is there a work around for this? are there HTTP functions I can use?
PHP Code:
echo"testing the ftp connection";
$ftp_server = "ftp.somesite.com";
// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
echo"Connected!!! </br>";
$ftp_user="name";
$ftp_pass="password";
// try to login
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";
}
// close the connection
ftp_close($conn_id);
echo"Connection closed!";
I'll be changing hosting company soon! I am really tired of the quirks with this bunch.
Thanks folks!