Submit Your Article Forum Rules

Results 1 to 2 of 2

Thread: I need a "work around" for PHP ftp functions

  1. #1
    Senior Member
    Join Date
    Jan 2008
    Posts
    118

    I need a "work around" for PHP ftp functions

    I need to automate some file transfers between two sites. I just tried the script below to see if I could connect and got nothing. Then I found out that my hosting (ATT/Yahoo) does not support the standard ftp functions of php.

    Is there a work around for this? are there HTTP functions I can use?

    PHP Code:
    echo"testing the ftp connection";
    $ftp_server = "ftp.somesite.com";

    // set up a connection or die
    $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
    echo
    "Connected!!! </br>";

    $ftp_user="name";
    $ftp_pass="password";
    // try to login
    if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
    echo
    "Connected as $ftp_user@$ftp_server\n";
    } else {
    echo
    "Couldn't connect as $ftp_user\n";
    }

    // close the connection
    ftp_close($conn_id);
    echo
    "Connection closed!";



    I'll be changing hosting company soon! I am really tired of the quirks with this bunch.
    Thanks folks!

  2. #2
    WebProWorld MVP
    Join Date
    Aug 2003
    Posts
    1,020

    Re: I need a "work around" for PHP ftp functions

    If they have socket functions enabled then you can use a pure PHP based FTP client.

    A quick google gives Class: Advanced FTP client class (ftp, socket, ftp class, sockets) - PHP Classes I've not tried it but there are others about. It's not that hard to write a pure PHP FTP client.

    If you just want to pull data from the remote server then you could try using curl functions (PHP: cURL - Manual) to read the data as you would a web page, however remember that data is publicly available unless you password protect it.

Similar Threads

  1. What is "Conversion Optimization" and How Does it Work?
    By watto in forum Search Engine Optimization Forum
    Replies: 9
    Last Post: 03-12-2010, 02:14 PM
  2. PR5 / PR3 Link Exchange With "work at home" Sites
    By logistas in forum Marketing Strategies Discussion Forum
    Replies: 1
    Last Post: 08-20-2008, 01:58 AM
  3. "nofollow" - Does it Really Work Like Google Claim
    By kimber23 in forum Google Discussion Forum
    Replies: 40
    Last Post: 03-30-2008, 01:16 AM
  4. SEO. Building portfolio - will work "for food"
    By Dervish in forum Items For Sale
    Replies: 1
    Last Post: 12-30-2005, 04:45 PM
  5. "Unpicked.com" - backorder, does it work ?? not th
    By David Pearson in forum Items For Sale
    Replies: 2
    Last Post: 06-03-2004, 11:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •