Upload Files trhough FTP Using PHP

User avatar
admin
Site Admin
Posts: 35
Joined: Sun Jul 03, 2016 2:17 pm
Location: India
Contact:

Upload Files trhough FTP Using PHP

Postby admin » Sun Jul 03, 2016 5:04 pm

In order to upload file/s or folder/s on web server using PHP Code one can use below mentioned sample script:

Code: Select all

<?php
require_once "PHPFTP.php";

$ftp = new PHPFTP();

$result = $ftp->Connect('www.yourdomain.com','login name','password');

if ($result == 0)
{
$ftp->DoCommand('enter command here', $result_number, $result_text);
echo "$result_text ($result_number)";
$ftp->DoCommand('another command', $result_number, $result_text);
echo "$result_text ($result_number)";
$ftp->Disconnect();

}

?>
Finest web hosting solution at the most affordable rates
Cheap Website Hosting
cheap VPS hosting india

Return to “Scripts / Code Snippets”

Who is online

Users browsing this forum: No registered users and 0 guests