hello kamui,
a part of your answer:
- identification of user
- read all the files/directory of a directory
todo:
- read a file for the transfert
- display only files on the list (actually all elements appears file & dir.)
find it on http://fpepito.dyndns.org/php/test2.php
see you, and hope that help you,
fpepito
[PHP]
<?
$logins = array(
"user" => "php",
"login" => "pass"
);
# quick check of user
function check_user ($log, $pas) {
global $logins;
if (($logins[$log] == $pas) && !($log == "") ) {
return 1;
} else {
return 0;
}
}
# read directory
function read_dir ($path) {
global $PHP_SELF,$login,$pass;
$ls = popen ("/bin/ls $path", "r");
echo "The link does not open the file
\n";
while (!feof($ls)) {
$buffer = fgetss($ls, 4096);
#here the link to read the file
echo "$buffer
";
}
}
if (isset($login) && (check_user($login,$pass)==1)) {
echo "welcome $login
";
read_dir ("/var/cache/man/X11R6");
} else {
echo "for test try:
\nlogin = user
\npass=php
\n";
echo "\n";
echo "Login :
\n";
echo "Pass :
\n";
echo "\n";
echo "\n";
}
?>
[/PHP]