Saturday, 17 December 2016

php ftp connectivity

03:07


PHP ftp_connect() Function:

Definition and Usage :

The ftp_connect() function opens an FTP connection to the specified host.

When the connection is open, you can run FTP functions against the server.

Syntax :

ftp_connect(host,port,timeout);


Example  code:

<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_username="ftpusername";
$ftp_userpass="ftppassword";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
if($login)
{
echo "connected to server";
}
else
{
echo "not connected to server";
}
// then do something...
// close connection
ftp_close($ftp_conn);
?>



Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

PHP Training Mumbai, PHP MySQL Training Mumbai, PHP Course Mumbai, PHP Institute Mumbai

 

© 2013 PHP TRAINING IN MUMBAI BY OM SIR . All rights resevered. Designed by OM SIR

Back To Top