web方式ftp(4) return $ftp; } } } function phpftp_list($phpftp_user,$phpftp_passwd,$phpftp_dir) { global $phpftp_host; phpftp_top(); ?> <!-- function phpftp_list --> <?php $ftp = @phpftp_connect($phpftp_user,$phpftp_passwd); if (!$ftp) { ?> <strong>FTP login failed!</strong> <a href="ftp.php">Start over?</a> <?php phpftp_bottom(); } else { if (!$phpftp_dir) { $phpftp_dir=ftp_pwd($ftp); } if (!@ftp_chdir($ftp,$phpftp_dir)) { ?> <font color="#ff0000"><strong>Can't enter that directory!</strong></font><p><p> <?php $phpftp_dir=ftp_pwd($ftp); } echo "<strong>Current host:</strong> " . $phpftp_host . "<br>\n"; echo "<strong>Current directory:</strong> " . $phpftp_dir . "<br>\n"; if ($phpftp_dir == "/") { $phpftp_dir=""; } if ($contents = ftp_rawlist($ftp,"")) {