Cita:
He tradado cambiando opendir("./"); por opendir("wallpapers"); y si me muestra lo que quiero pero me sale este error...
Iniciado por Codigo
Código PHP:
<?
Function GetFileType($file){$ext[0]="mp3";$graph[0]="audio";$ext[1]="mp2";$graph[1]="audio";$ext[2]="wav";$graph[2]="audio";$ext[3]="wma";$graph[3]="audio";$ext[4]="ogg";$graph[4]="audio";$ext[5]="css";$graph[5]="css";$ext[6]="doc";$graph[6]="doc";$ext[7]="rtf";$graph[7]="doc";$ext[8]="exe";$graph[8]="exe";$ext[9]="gif";$graph[9]="gif";$ext[10]="jpg";$graph[10]="jpg";$ext[11]="chm";$graph[11]="chm";$ext[12]="mov";$graph[12]="mov";$ext[13]="pdf";$graph[13]="pdf";$ext[14]="php";$graph[14]="php";$ext[15]="php3";$graph[15]="php";$ext[16]="rpv";$graph[16]="php";$ext[17]="png";$graph[17]="png";$ext[18]="psd";$graph[18]="psd";$ext[19]="swf";$graph[19]="swf";$ext[20]="rar";$graph[20]="tar";$ext[21]="gz";$graph[21]="tar";$ext[22]="txt";$graph[22]="txt";$ext[23]="mpg";$graph[23]="video";$ext[24]="mpeg";$graph[24]="video";$ext[25]="avi";$graph[25]="video";$ext[26]="wmv";$graph[26]="video";$ext[27]="asf";$graph[27]="video";$ext[28]="htm";$graph[28]="web";$ext[29]="html";$graph[29]="web";$ext[30]="mht";$graph[30]="web";$ext[31]="zip";$graph[31]="zip";
if(!is_dir($file)){for($a=0;$a<=31;$a++){if(eregi("$ext[$a]$",$file)){$ret=$graph[$a];break;}}
}else{$ret="folder";}$ret=($ret!="")?$ret:"unknow";return $ret;
} $opdir=opendir("./");while($folder=readdir($opdir)){$files[count($files)]=$folder;}closedir($opdir);
for($i=0;$i<count($files);$i++){if(($files[$i]!="subidas1.php")&&($files[$i]!="subidas.php")&&($files[$i]!="subir.php")&&($files[$i]!="IMG")&&(!eregi("\.$",$files[$i]))){echo "
<tr valign=middle bgcolor=#CCCCCC>
<td height=20 align=center><a href='".urlencode($files[$i])."' target='_blank'><img src=IMG/RPVdesign.com_shared_page_icons_".GetFileType($files[$i]).".gif width=16 border=0 height=16></a></td>
<td height=20><a href='".urlencode($files[$i])."' class=Text target='_blank'> $files[$i]</a></td>
<td height=20 align=center><a href='".urlencode($files[$i])."' class=Text target='_blank'>".round((filesize($files[$i])/1024),2)." Kb</a></td>
<td height=20 align=center><a href='".urlencode($files[$i])."' title='".date ("d.m.Y / H.i:s",filemtime($files[$i]))."'; class=Text target='_blank'>".date ("d.m.Y",filemtime($files[$i]))."</a></td>
</tr>";
}}?>
Warning: filesize(): Stat failed for RaceCar.jpg (errno=2 - No such file or directory) in /home/rally/public_html/subidas/subidas.php on line 40
Warning: filemtime(): Stat failed for RaceCar.jpg (errno=2 - No such file or directory) in /home/rally/public_html/subidas/subidas.php on line 41
Warning: filemtime(): Stat failed for RaceCar.jpg (errno=2 - No such file or directory) in /home/rally/public_html/subidas/subidas.php on line 41
Editado por josemi: siempre que pongas codigo PHP, mejor lo pones entre tags [ PHP ] y [ /PHP ] (sin los espacios). Asi el codigo se vera coloreado y mucho mas claro