- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ftp_login() function in PHP
The ftp_login() function allows you to log in to the FTP connection.
Syntax
ftp_login(con,user_name,password);
Parameters
con − The FTP connection
user_name − The user name to log in
password − The password to login
Return
The ftp_login() function returns TRUE on success or FALSE and warning on failure.
Example
The following is an example −
<?php $ftp_server="192.168.0.4"; $ftp_user="amit"; $ftp_pass="tywg61gh"; $con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($con, $ftp_user, $ftp_pass); if (@ftp_login($con, $ftp_user, $ftp_pass)) { echo "Connection established!"; } else { echo "Failed in establishing a connection!"; } ftp_close($con); ?>
Advertisements