PHP的FTP学习(二)
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:30:50
Original
1102 people have browsed it
<script>ec(2);</script>
By Vikram Vaswani
Melonfire
November 07, 2000
登录了FTP服务器,PHP提供了一些函数,它们能获取一些关于系统和文件以及目录的信息。
FTP_pwd()
如果你想知道你当前所在的目录时,你就要用到这个函数了。
--------------------------------------------------------------------------------
// get current location
$here = FTP_pwd($conn);
?>
--------------------------------------------------------------------------------
万一你需要知道服务器端运行的是什么系统呢?
FTP_systype()正好提供给你这方面的信息。
--------------------------------------------------------------------------------
// get system type
$server_os = FTP_systype($conn);
?>
--------------------------------------------------------------------------------
关于被动模式(PASV)的开关,PHP也提供了这样一个函数,它能打开或关闭PASV(1表示开)
--------------------------------------------------------------------------------
// turn PASV on
FTP_pasv($conn, 1);
?>
--------------------------------------------------------------------------------
现在,你已经知道你在“哪里”和“谁”跟你在一起了吧,现在我们开始在目录中逛逛--实现这一功能的是FTP_chdir()函数,它接受一个目录名作为参数。
--------------------------------------------------------------------------------
// change directory to "public_html"
FTP_chdir($conn, "public_html");
?>
--------------------------------------------------------------------------------
如果你想回到你刚才所在的目录(父目录),
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
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31