Hi people,
I have a trouble displaying the files that are in my folder.
Here, I try to display the name of the files and their description.
I succeeded to display their description but not the files !
Please, help me
include('Cfg/config.inc.php');
mysql_connect($SERVER,$USER,$PWD)or die('Can not connect to the MySQL server <br/>'.mysql_error());
mysql_select_db($DB)or die('Can not select the requested database<br/>'.mysql_error());
$qd="SELECT * FROM downloads";
$rd=mysql_query($qd)or die('Impossible to perform the selection query<br/>'.mysql_query());
echo'<TABLE class="tabledownloads">';
while($rowd=mysql_fetch_assoc($rd)){
echo '<TR>';
echo'<td>';
$dirdown="admin/uploads";
$dossierdown=opendir($dirdown);
while($fichierdown=readdir($dossierdown)){
$berkdown=array('.','..','index.php');
$liendown=$dirdown.'/'.$fichierdown;
if(file_exists($liendown)&&$rowd['systemfilename']==$fichierdown){
echo '<a href="'.$liendown.'"><font color="blue"><b>'.stripslashes($rowd['userfilename']).'</b></font></a>';
echo'</td>';
}
}
echo'<td>';
echo stripslashes($rowd['filedescription']);
echo'</td>';
echo'</TR>';
}
echo'</TABLE>';
?>