Hi,
I'm trying to connect to my server using php script to upload some files...
But it doesn't connect...
I dont know what is the error...
I'm sure that ftp is enable, i checked it through php_info()
What may be the error...
<?php
error_reporting(E_ALL);
$ftp_server = "server.com"; //address of ftp server (leave out ftp://)
$ftp_user_name = "Username"; // Username
$ftp_user_pass = "Password"; // Password
$conn_id = ftp_connect($ftp_server); // set up basic connection
$login_result = ftp_login($conn_id,$ftp_user_name,$ftp_user_pass);
if ($login_result = ftp_login($conn_id,$ftp_user_name,$ftp_user_pass)) {
echo "Connected as ,$ftp_user_name,$ftp_user_pass \n";
} else {
echo "Couldn't connect \n";
}
.....
.....
....
....
ftp_close($conn_id); // close the FTP stream
?>