1
Hi all, I stumbled across a script that I think allows FTP access to a server through a webpage using PHP. This has me very interested as I would like to give my clients a simple FTP client from my website but i'm not sure if this is posible.
I thought this is a good way to share the script also

as it would be quite useful to a lot of people.
I tried adding the script into a custom block and well the block won't even show up.
I'm using 2.0.13 and below is the script:
$host = "";
$user = "";
$password = "";
$ftp_connection = ftp_connect($host);
@ftp_login($ftp_connection, $user, $password);
$path = $HTTP_GET_VARS["path"];
$parent = substr($path, 0, strrpos($path, "/"));
$file_list = ftp_nlist($ftp_connection, $path);
?>
if($path != "") { ?>
= $_SERVER["PHP_SELF"] ?>?path== $parent ?>">..
} ?>
for($index = 0; $index < sizeof($file_list); $index++) { ?>
$file_size = ftp_size($ftp_connection, $file_list[$index]);
//Format the file name so that it doesn't include the full path.
if($path == "")
$file_name = $file_list[$index];
else
$file_name = substr($file_list[$index], strrpos($file_list[$index], "/") + 1,
strlen($file_list[$index]) - strrpos($file_list[$index], "/"));
?>
//Find out if it's a file or a directory. ?>
if($file_size == -1) { ?>
= $_SERVER["PHP_SELF"] ?>?path== $file_list[$index] ?>"> } ?>
= $file_name ?> if($file_size == -1) { ?> } ?>
} ?>
ftp_close($ftp_connection);
?>
Maybe this code is only for a stand alone webpage.php or maybe even a one page module??
Does anyone have any ideas??
Marty.