Obadiah Posted October 17, 2006 Share Posted October 17, 2006 what im attempting to do is get php to spill rthe contents of the files in the last folder...right now it will only search the folders preceding the last and when it gets to the last one it opens it but doesent search the files inside....can anyone help me?!?<?php $indent = str_repeat("\t", 5); $dirname = "resids/{$_SESSION['logname']}/{$_POST['xyz']}"; $filename= "*.pdf"; if (!is_dir($dirname)) { $dirname="{$_POST['xyz']}"; echo $indent . '<option>Invalid directory specified.</option></select><br>'; echo "<select name=\"abc\">"; $dh=opendir($ob) or die("couldn't open directory"); while(!(($filea = readdir($dh)) === false)) { echo"<option>$filea</option>"; } echo "</select>"; } else { $dh = opendir($dirname) or die("couldn't open directory"); while(($file = readdir($dh)) !== false) { if ($file != '.' and $file != '..') { echo $indent . '<option' . ((isset($_POST['xyz']) && $_POST['xyz'] == $file) ? ' selected="selected"' : '') . '>' . $file . '</option>' . PHP_EOL; } } } ?> Quote Link to comment Share on other sites More sharing options...
Obadiah Posted October 18, 2006 Author Share Posted October 18, 2006 anyone?!? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.