Php ftp Learning (2)-PHP source code

Source: Internet
Author: User
Ec (2); ByVikramVaswaniMelonfireNovember07, 2000 logged on to the FTP server. PHP provides some functions that can obtain information about systems, files, and directories. FTP_pwd () If you want to know your current directory, you need to use this function. ------------- Script ec (2); script


By Vikram Vaswani
Melonfire
November 07,200 0
After logging on to the FTP server, PHP provides some functions that can obtain information about the system, files, and directories.

FTP_pwd ()
If you want to know your current directory, you need to use this function.
--------------------------------------------------------------------------------

// Get current location
$ Here = FTP_pwd ($ conn );

?>
--------------------------------------------------------------------------------
In case you need to know what system the server is running?
FTP_systype () is provided to you in this regard.
--------------------------------------------------------------------------------

// Get system type
$ Server_ OS = ftp_cmdype ($ conn );

?>
--------------------------------------------------------------------------------
Regarding the PASV switch, PHP also provides a function that enables or disables PASV (1 indicates on)
--------------------------------------------------------------------------------

// Turn PASV on
FTP_pasv ($ conn, 1 );

?>
--------------------------------------------------------------------------------

Now, you know where you are and who you are with. Now we are going to browse through the directory-The FTP_chdir () function is used to implement this function, it accepts a directory name as a parameter.
--------------------------------------------------------------------------------

// Change directory to "public_html"
FTP_chdir ($ conn, "public_html ");

?>
--------------------------------------------------------------------------------
If you want to return to the directory (parent directory) where you are located ),

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.