Welcome to PCCS-Linux.COM Hello, and welcome to the PCCS-Linux Home Page.
Your last visit was !!!
Your Browser is running on Other
 
FTP Functions

You need to compile php with the ./configure --with-ftp

I will only show you code of some code hacked together...
Tried to use most of the functions available to PHP

<?

$result = ftp_connect("",21) or die ("Failed to connect to FTP
server");
$connect = ftp_login($result,"username","password") or die("Failed to
login");
$systype = ftp_systype($result);
echo $systype . "  Ftp Server<br>\n";
$pwd = ftp_pwd($result);
$_dir = "$pwd/public_html";

/* Make a directory */
// ftp_mkdir($result,$_dir);

ftp_chdir($result,$_dir);

$pwd = ftp_pwd($result);
$a = "/home/username/web/index.html";
$b = "$_dir/index.html";

/* rawlist or inlist */

// ftp_put($result, $b,$a, FTP_BINARY);
$list = ftp_rawlist($result,$pwd);
for($i=0; $i < count($list); $i++) {
        echo $list[$i] . "
\n"; } // ftp_rename($result, $b,$a, FTP_BINARY); // ftp_delete($result, $_dir/$filename); ftp_quit($result); ?>

>> Comments/FeedBack


Page hits 46 last request on :11:44



This web site is prepared and maintained by Chauncey Thorn.
The information contained in this site was valid at the time of posting.
Chauncey Thorn, assumes no liability for damages incurred directly or indirectly as a result of errors, omissions or discrepancies.

Remember most of the content here are my notes...

All logos and trademarks in this site are property of their respective owner. All the rest © by PCCS-Linux.COM

PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002