ev5unleash Posted January 25, 2010 Share Posted January 25, 2010 Hey Guys, I need help, I tried a ton of directory listing scripts and they all don't work. Althogh the normal Apache Directory Indexing does work when you visit. The URL is http://ev5unleash.dnsalias.org. The PHP directory listing is http://ev5unleash.dnsalias.org/test.php I'm currently running Wamp 2.0 (Apache/PHP/MySQL). Need a fix asap. Quote Link to comment Share on other sites More sharing options...
jl5501 Posted January 25, 2010 Share Posted January 25, 2010 You have your php code showing in the output - it is not being run a) Are you sure you have php enabled? b) as you are using short tags, are you sure you have php short tags enabled? to test for the latter, change <? to <?php and <?= to <?php echo Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted January 25, 2010 Author Share Posted January 25, 2010 Thanks for the quick response. 1. I know the PHP is running because I get PHP error scripts when I do something wrong. I tried scripts like this: <? //define the path as relative $path = "/home/yoursite/public_html/whatever"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "Directory Listing of $path<br/>"; //running the while loop while ($file = readdir($dir_handle)) { echo "<a href='$file'>$file</a><br/>"; } //closing the directory closedir($dir_handle); ?> But it doesn't respond with anything on the page. Just blank. Quote Link to comment Share on other sites More sharing options...
jsschmitt Posted January 25, 2010 Share Posted January 25, 2010 Thanks for the quick response. 1. I know the PHP is running because I get PHP error scripts when I do something wrong. I tried scripts like this: <? //define the path as relative $path = "/home/yoursite/public_html/whatever"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "Directory Listing of $path<br/>"; //running the while loop while ($file = readdir($dir_handle)) { echo "<a href='$file'>$file</a><br/>"; } //closing the directory closedir($dir_handle); ?> But it doesn't respond with anything on the page. Just blank. Did you make sure to turn on short open tags? Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted January 25, 2010 Author Share Posted January 25, 2010 Thanks so much, that helped out a lot. Stupid WAMP, I don't know why they enable those basic configurations in it's build. Quote Link to comment Share on other sites More sharing options...
jsschmitt Posted January 25, 2010 Share Posted January 25, 2010 Thanks so much, that helped out a lot. Stupid WAMP, I don't know why they enable those basic configurations in it's build. Not a problem... ran into the same issue myself ^.^ 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.