Jump to content

PHP Directory


nyyankeefan95

Recommended Posts

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.

Link to comment
Share on other sites

<?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... -_-'

Link to comment
Share on other sites

<?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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.