als ik het onderstaande php scriptje gebruik, dan leest hij de directory vlekkeloos, alleen als ik dan nieuwe mappen upload in die directory, dan komen die automatisch onderaan te staan, en niet zoals ik wil, op alfabetische volgorde..
Iemand een idee?
Iemand een idee?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| <?php
if(!empty($HTTP_GET_VARS['dir']))
{
$dir=$HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/'.$HTTP_GET_VARS['dir'];
$d=&$HTTP_GET_VARS['dir'];
}
else
{
$dir='.';
$d='.';
}
clearstatcache();
if($a=@opendir($dir))
{
while($b=readdir($a))
{
if(ereg("^\.",$b))
continue; // ignore hidden files
echo (is_dir($b))?"<body bgcolor=#F09FEC link=#000000 vlink=#000080 alink=#000000>
<font face=tahoma size=2><li> <a href=http://www.blabla.com/bla/bla/$b target=_blank>$b</a>":"<li>
<a href=$d/$b target=_blank>$b</a><br><p>";
}
closedir($a);
}
else
{
echo 'unable to open directory';
}
?> |
Power corrupts. Knowledge is power. Study hard. Be evil.