tags:

views:

25

answers:

1

Hello,

What I am trying to accomplish is getting relative and absolute paths to files, images and folders that reside on a remote server.

I have website address, and FTP details (these are required when signing up). What i need to know is whether the FTP details correspond correctly with the website.

Firstly I used (this is all in PHP I forgot to add) :

$conn_id = ftp_connect("ftp.".$WEBSITE); 
if($login_result = ftp_login ($conn_id, $ftpUser, $ftpPass))

which works. BUT what i dont know, and am not sure about at all, will ("ftp.".$WEBSITE) be sufficient for all "FTP servers"? Regards, Phil Jackson

A: 

It would not be sufficient for all FTP servers as not all sites have DNS records setup for FTP. Also, nowadays it's not uncommon for web hosts to have their clients ftp to www.example.com rather than ftp.example.com.

I'd also be inclined to check www.example.com too.

Terrell
I do run a 200 response check. Are you saying that it is either or www. ftp. ?? Always? or can it be completely different?
Phil Jackson
The hostname could be anything... host.com, www.host.com, ftp.host.com, or even ftp.hostingcompany.com. I don't think it's safe to assume the FTP server will always be a subdomain named "ftp". If I were in your situation, I'd probably try several cases.
Terrell