Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

connect to ftp server php

$host= 'ftp.example.com';$user = 'notarealusername';$password = 'notarealpassword';$ftpConn = ftp_connect($host);$login = ftp_login($ftpConn,$user,$password);// check connectionif ((!$ftpConn) || (!$login)) { echo 'FTP connection has failed! Attempted to connect to '. $host. ' for user '.$user.'.';}else{ echo 'FTP connection was a success.'; $directory = ftp_nlist($ftpConn,''); echo ''.print_r($directory,true).'';}ftp_close($ftpConn);
Source by www.hashbangcode.com #
 
PREVIOUS NEXT
Tagged: #connect #ftp #server #php
ADD COMMENT
Topic
Name
3+5 =