nyyankeefan95 Posted December 10, 2010 Share Posted December 10, 2010 Hello, can someone please help me make this. I want a simple php directory script that lists files and folders. If a folder is clicked on then open that directory and if a file is clicked on it will download or if its a .txt or picture it will open in the browser. BUT I NEED IT TO LOOK EXACTLY LIKE THIS: http://test512.x10.mx/ which would be the default cpanel indexing but i use godaddy and i dont like there indexing page. Please help and whoever make it i will provide a subdomain on my website for you to host your stuff. Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/ Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 <?php $ignorefile='index.html'; if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && $file != $ignorefile) { echo '<br /><a href="'.$file.'">'.$file.'</a>'; } } closedir($handle); } ?> ^ is pretty close, I'm not going to create an exact copy of the auto one... ' Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145573 Share on other sites More sharing options...
nyyankeefan95 Posted December 10, 2010 Author Share Posted December 10, 2010 <?php $ignorefile='index.html'; if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && $file != $ignorefile) { echo '<br /><a href="'.$file.'">'.$file.'</a>'; } } closedir($handle); } ?> ^ is pretty close, I'm not going to create an exact copy of the auto one... ' This works a little bit. When i open a picture ot .txt file it opens it in the browser but when i click on a folder i get this error: Forbidden You don't have permission to access /BahnDaten and WagenDaten Creator/ on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at updates.sylenttechnologies.com Port 80 And i need the list to be bulleted and i need an (Index /) text at the heading Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145580 Share on other sites More sharing options...
MatthewJ Posted December 10, 2010 Share Posted December 10, 2010 Sounds like you "need" a book on PHP... Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145582 Share on other sites More sharing options...
nyyankeefan95 Posted December 10, 2010 Author Share Posted December 10, 2010 Sounds like you "need" a book on PHP... I know but i need to meet a deadline for tonight. Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145583 Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 ofc, you can't access that folder, unless you turn on folder listing or put a similar file in that folder. If you use apache and have access to this file: apache/conf/httpd.conf edit it... read here: http://wiki.apache.org/httpd/FAQ#How_do_I_turn_automatic_directory_listings_on_or_off.3F restart apache Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145586 Share on other sites More sharing options...
nyyankeefan95 Posted December 10, 2010 Author Share Posted December 10, 2010 Now i get this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. I am using godaddy hosting btw Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145587 Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 edit it back then o.o http://wiki.apache.org/httpd/FAQ#How_do_I_turn_automatic_directory_listings_on_or_off.3F do what it says there, it should work! Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145590 Share on other sites More sharing options...
nyyankeefan95 Posted December 11, 2010 Author Share Posted December 11, 2010 edit it back then o.o http://wiki.apache.org/httpd/FAQ#How_do_I_turn_automatic_directory_listings_on_or_off.3F do what it says there, it should work! That shows the standard apache directory listing that i dont like. Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145591 Share on other sites More sharing options...
MMDE Posted December 11, 2010 Share Posted December 11, 2010 lol? =P the link you showed me, that isn't the standard? Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145592 Share on other sites More sharing options...
nyyankeefan95 Posted December 11, 2010 Author Share Posted December 11, 2010 No thats cpanels standard not apaches but i want to use cpanels standard Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145593 Share on other sites More sharing options...
chronister Posted December 11, 2010 Share Posted December 11, 2010 Sounds like you "need" a book on PHP... I know but i need to meet a deadline for tonight. LOL... I love it when folks are all like "I have a deadline to meet and don't know what I am doing.... save me". I mean I am not going to tell someone I will rebuild their car by tomorrow night, knowing full well I am not a mechanic. too funny. Folks need to fail and learn not to oversell their abilities rather than having others bail them out. Not trying to be a dick or anything, but your deadline is of no concern to the folks who donate their time for free on here. Quote Link to comment https://forums.phpfreaks.com/topic/221262-php-directory/#findComment-1145600 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.