Jump to content

directory browsing script ... Help?


JP128

Recommended Posts

[code]
<?php
$files = scandir($_SESSION['filedir1']);
foreach ($files as $file){
if(is_dir($file)){
$file = $file."/";
}
echo"<option value='$file' onClick=\"document.form1.filefrommenu.value='$file'\">".$file."</option>";
  }
  ?>
        </select>[/code]

what the other page gets:
[code]
<?php
if(isset($_POST['browsefile1'])){
$dirtobrowse = $_POST['file1'];
$_SESSION['filedir1'] = $_SESSION['filedir1'].$dirtobrowse;
header("Location: revisedgetfile.php");
}
?>[/code]


I don't know what else to use.... any suggestions?
Link to comment
https://forums.phpfreaks.com/topic/30861-directory-browsing-script-help/
Share on other sites

Ok, here are my problems.
I have a script that will output all of the files in the directory called /htdocs/ into an option list... No problem with seeing them. My problem is when I click browse, it sends it to a page that will see if that is what the user clicked, and still no problem. After it gets to there, and I want it to change the current directory, and then go back to the file page, the only problem is that the directory never changes...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.