View previous topic :: View next topic |
Author |
Message |
Beta5 -
Joined: 08 Jun 2005 Posts: 13
|
Posted: Fri Jun 17, 2005 9:27 pm Post subject: how to list files in a directory? |
|
|
Does anyone have a php script that can list files in a directory?
im looking for something like the one in abyss has, tho i dont want it to just have a white background or something like that, I wanna be able to customize it with my only logo and stuff lol? |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jun 18, 2005 11:39 am Post subject: Re: how to list files in a directory? |
|
|
Beta5,
There is a whole chapter in the user's guide of Abyss Web Server that explains how to customize directory listings using simple SSI templates (no programming) or using scripts (in PHP or any language). Basic examples are also there: http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/dirlist.html . _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
Beta5 -
Joined: 08 Jun 2005 Posts: 13
|
Posted: Sun Jun 19, 2005 11:53 pm Post subject: |
|
|
ok i got the directory list thing working.
but im having a little problem trying to remove one code, everytime i try to change it, the hole thing doesn't show.
If you dont know what im talking about heres a pic,
i have kinda squared the thing that I want to remove in red.
This is the php script
Quote: | <?php
$adir=opendir(str_replace("\\","\\\\",getcwd()));
$dir=str_replace("\\","/",substr(getcwd(),11,strlen(getcwd())))."/";
echo "<table border=0 cellpadding=1 cellspacing=2 width=100% height=><td><b>Name</b></td><td width=70 align=center><b>Size</b></td>";
while (false !== ($arch = readdir($adir))) {
if($arch!='.' && $arch!='index.php'){
echo "<tr><td bgcolor=#F5F5F5><a href=".rawurlencode($arch).">".ucfirst($arch)."</a></td><td bgcolor=#F5F5F5 align=center>";
if (filesize($arch)>0) echo number_format(filesize($arch));
else echo "--";
}
}
echo "</td></table>";
?>
</body> |
So ya can someone help me remove that one line in that pic i squared in red? |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Jun 20, 2005 5:40 am Post subject: |
|
|
Edit: What I said was completely Off Topic , read Aprelium's reply.
Last edited by TRUSTAbyss on Mon Jun 20, 2005 4:14 pm; edited 1 time in total |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Jun 20, 2005 1:40 pm Post subject: |
|
|
Beta5,
Change the line:
Code: |
if($arch!='.' && $arch!='index.php'){
|
to:
Code: |
if($arch!= '..' && $arch!='.' && $arch!='index.php'){
|
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
Beta5 -
Joined: 08 Jun 2005 Posts: 13
|
Posted: Thu Jun 23, 2005 6:03 pm Post subject: |
|
|
aprelium wrote: | Beta5,
Change the line:
Code: |
if($arch!='.' && $arch!='index.php'){
|
to:
Code: |
if($arch!= '..' && $arch!='.' && $arch!='index.php'){
|
|
Thanks again, it works perfectly :) |
|
Back to top |
|
 |
|