Need to display a directory on a page kinda
17 posts
• Page 1 of 2 • 1, 2
Need to display a directory on a page kinda
I need to take a directory and display all the files on a web page. But add in like CSS so I can change the fonts etc. Can this be done?
- xxsonyboy4lfexx
- Posts: 315
- Joined: Sat Jan 07, 2006 4:42 pm
- Location: California
Umm I don't know PHP so is there something I need to put before and after that code? It is just coming up as text.
- xxsonyboy4lfexx
- Posts: 315
- Joined: Sat Jan 07, 2006 4:42 pm
- Location: California
http://tournamentgamingworld.com/downloads.php
There's the page. I added the php thing before and after the code so now it's longer code
There's the page. I added the php thing before and after the code so now it's longer code
- xxsonyboy4lfexx
- Posts: 315
- Joined: Sat Jan 07, 2006 4:42 pm
- Location: California
you could also try this here...
- Code: Select all
<?
/**
* Change the path to your folder.
*
* This must be the full path from the root of your
* web space. If you're not sure what it is, ask your host.
*
* Name this file index.php and place in the directory.
*/
// Define the full path to your folder from root
$path = "/hsphere/local/home/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
echo "<a href="$file\">$file</a><br>";
}
// Close
closedir($dir_handle);
?>
17 posts
• Page 1 of 2 • 1, 2
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 3 guests