trying to connect to my server with the following script:
<?php
$ftp_server = "xxxxxx";
$ftp_user_name = "xxxx";
$ftp_user_pass = "xxxxx";
// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
// 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 $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
?>
i get the following server error:
Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/sites/site4/web/ftp.php on line 11
is it my script? can someone let me know what my problem is?
thanks in advance.
<?php
$ftp_server = "xxxxxx";
$ftp_user_name = "xxxx";
$ftp_user_pass = "xxxxx";
// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
// 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 $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
?>
i get the following server error:
Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/sites/site4/web/ftp.php on line 11
is it my script? can someone let me know what my problem is?
thanks in advance.