Home > Backend Development > PHP Tutorial > php test ftp connection

php test ftp connection

WBOY
Release: 2016-08-08 09:20:32
Original
1242 people have browsed it

php test ftp connection script is as follows:

<?php
    $host = "xxx.xxx.xxx.xxx";
    $user = "username";
    $pwd = "password";
    $port = "21"; 
    $conn   = @ftp_connect($host, $port) ;

    if($conn == false) {
        echo "conn fail!";
    } else {
        echo "conn success!";
    }

    $login = @ftp_login($conn, $user, $pwd);
    if(empty($login)) {
        echo "login fail!";
    } else {
        echo "login success!";
    }
?>
Copy after login


Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the PHP test ftp connection, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template