Jump to content
raynor009

indexare fisiere dintr-un folder de pe FTP

Recommended Posts

Pai altfel nu ai cum. Poti, spre exemplu, sa nu pui index pe acel ftp, eventual decat parolat, si vei vedea toate fisierele de forma vasile_are_mere.rar/.zip/.exe/.jpg (whateva extensie). In rest... ai aplicatii web, chiar si open source, care fac acest lucru cu succes.

Link to comment
Share on other sites

urci un shell la care pui parola :)

nu imi place sa ma incurc cu shelluri, + ca unele sunt virusate

Pai altfel nu ai cum. Poti, spre exemplu, sa nu pui index pe acel ftp, eventual decat parolat, si vei vedea toate fisierele de forma vasile_are_mere.rar/.zip/.exe/.jpg (whateva extensie). In rest... ai aplicatii web, chiar si open source, care fac acest lucru cu succes.

nume nu dai?

Link to comment
Share on other sites

  • Active Members
<?php  
if(isset($_REQUEST['dir'])) {
$current_dir = $_REQUEST['dir'];
} else {
$current_dir = 'folder';
}

if ($handle = opendir($current_dir)) {
while (false !== ($file_or_dir = readdir($handle))) {
if(in_array($file_or_dir, array('.', '..'))) continue;
$path = $current_dir.'/'.$file_or_dir;
if(is_file($path)) {
echo '<a href="'.$path.'">'.$file_or_dir."\n</a><br/>";
} else {
echo '<a href="script.php?dir='.$path.'">'.$file_or_dir."\n</a><br/>";
}
}
closedir($handle);
}
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...