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. Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/ 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 Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/#findComment-1001315 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. Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/#findComment-1001330 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? Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/#findComment-1001332 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. Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/#findComment-1001341 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 ^.^ Link to comment https://forums.phpfreaks.com/topic/189738-php-directory-listing-not-working/#findComment-1001342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.