Bluehost.com Web Hosting $6.95

Question about setting up FTP Upload and using the FTP suite...

This is a discussion on Question about setting up FTP Upload and using the FTP suite... within the PHP General forums, part of the PHP Programming Forums category; Hello all, I am just trying to see if I can connect up with my internal FTP server from our ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-14-2008
Mike McGonagle
 
Posts: n/a
Default Question about setting up FTP Upload and using the FTP suite...

Hello all,
I am just trying to see if I can connect up with my internal FTP server from
our website. The server is accessible from the outside world, as we can log
in using a client, etc. I am not really sure how to troubleshoot this, but
below is the script that I have. I "found" it on the net (and can't remember
where), and changed it a bit for my needs. It would appear that the call to
'ftp_connect' is where it fails. I tried this with both a URL as well as the
actual IP address, both error at the same place with the same error. Is
there a way to get an actual error message that is a bit more explanatory as
to what is happening?

<?php
$ftp_server = "FTP.URL";
$ftp_user = "USER";
$ftp_pass = "PASSWORD";

echo "Trying to connect with $ftp_server using $ftp_user, $ftp_pass";

// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server");

if ($conn_id) {
echo "Logging in as $ftp_user, $ftp_pass.";
$login = ftp_login($conn_id, $ftp_user, $ftp_pass);

// try to login
if ($login) {
echo "Connected as $ftp_user@$ftp_server\n";
} else {
echo "Couldn't connect as $ftp_user\n";
}

// close the connection
ftp_close($conn_id);
} else {
echo "Could not establish connection";
}
?>

Thanks for your help,

Mike

--
Peace may sound simple—one beautiful word— but it requires everything we
have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:24 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0