Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am having trouble understanding why the following code will not connect to the ftp site in the code. Other sites work fine so I think the code is OK. On the other hand I can connect to ftp.atmos.washington.edu through a command prompt or ws_ftp. Any suggestions?Code: Select all
<?php
// set up basic connection
$ftp_server = "ftp.atmos.washington.edu";
$conn_id = ftp_connect($ftp_server);
// check connection
if (!$conn_id) {
echo "No connection made!";
}
else {
$login_result = ftp_login($conn_id, "anonymous", "gtm");
if ((!$login_result)) {
echo "<P>FTP connection has failed!";
echo "<P>Attempted to connect to $ftp_server";
exit;
}
else
echo "<P>Connected to $ftp_server, for user $ftp_user_name";
}
ftp_close($conn_id);
?>Thanks
George
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]