Thanks but I am still having trouble connecting to the ftp server. this is the error message I am getting:
Warning: Unable to find ftpbuf 0 in template name on line 6
Ftp connection has failed!Attempted to connect to www2.famvid.com/spyder for user
===========================================
and here is the code:
<?php
// set up basic connection
$conn_id = ftp_connect("$ftp_server");
// login with username and password
$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "Ftp connection has failed!";
echo "Attempted to connect to $ftp_server for user $user";
die;
} else {
echo "Connected to $ftp_server, for user $user";
}
// transfer the file
$transfer = ftp_get($conn_id, "$destination_file", "$source_file", FTP_BINARY);
// check transfer status
if (!$transfer) {
echo "Ftp transfer has failed!";
} else {
echo "Transfered $source_file as $destination_file";
}
// close the FTP stream
ftp_quit($conn_id);
?>
Why wont it connect to the ftp server? Id and Pass are correct. Do you have to connect to the root and then ftp_chdir to the directory you want or can you use a non root path to connect? For example "ftp://thesite.com/will/this/work" as "$ftp_server"? Or is something not configured correctly (on the ftp or my php)?
Thanks for the advice before, I have been using a friends "professional php programming" book (as I am very new to this php thing) and it doesn't even give the ftp functions (not even in the Appendix)!! I would say it was worth every cent of the $50 bucks he paid for it!