iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-30-2008, 01:20 AM
WebProWorld Pro
 
Join Date: Jan 2008
Location: Reno, Nevada
Posts: 125
alhefner RepRank 1
Default 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!
__________________
My outdoor blog
Reply With Quote
  #2 (permalink)  
Old 10-30-2008, 09:14 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 957
speed RepRank 1
Default 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.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PR5 / PR3 Link Exchange With "work at home" Sites logistas Link Exchange 1 08-20-2008 01:58 AM
"nofollow" - Does it Really Work Like Google Claim kimber23 Google Discussion Forum 40 03-30-2008 01:16 AM
how to work with CSS building the "skeleton" of th duffs22 Graphics & Design Discussion Forum 1 03-22-2007 01:12 PM
SEO. Building portfolio - will work "for food" Dervish Services for Sale/Hire 1 12-30-2005 04:45 PM
"Unpicked.com" - backorder, does it work ?? not th David Pearson Domain Discussion Forum 2 06-03-2004 11:36 AM


All times are GMT -4. The time now is 04:17 AM.



Search Engine Optimization by vBSEO 3.3.0