Voila le fichier listedir.php avec la déclaration de variable au début .. avant j'utilisais pas de variable et je mettais "." pour le dossier ca marchait .. Maintenant quand je rentre un dossier, ca marche desfois à moitié ...
-----------SIMNET SA WEB SOURCE WWW.SIMNETSA.CH---------
<html>
<head>
</head>
<body>
<?
//SOURCE DU PROBLEME EST ICI
$dossiercours = "../Windows";
$Dir = htmlspecialchars($dossiercours);
$Dir = str_replace("\\", "/", $Dir);
$champs = explode ("/", $Dir);
$boucle=0;
while ($boucle < sizeof($champs)-1) {
$boucle++;
}
$lienrel = $champs[$boucle];
$champs[$boucle] = ucfirst( strtolower($champs[$boucle]) ) ;
?>
<div align="center">
<center>
<table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="84%" id="AutoNumber1">
<tr>
<td width="164">
<p align="left">
<img border="0" src="images/Dossier_Petit.jpg" width="125" height="68"></td>
<td width="76%" valign="bottom"><b>
<font face="Verdana" size="5" color="#000080"><?echo $champs[$boucle];?></font></b></td>
</tr>
<tr>
<td width="100%" colspan="2" style="border-left-width: 1; border-right-width: 1; border-top: 1px solid #000080; border-bottom-width: 1"> </td>
</tr>
</table>
</center>
</div>
<p> </p>
<div align="center">
<center>
<table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="85%" id="AutoNumber1" height="98">
<tr>
<td width="33%" height="30" valign="top">
<table border="1" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="101%" id="AutoNumber2" height="36">
<tr>
<td width="101%" bgcolor="#482B7F" height="13">
<p align="center"><b><font face="Verdana" size="1" color="#FFFFFF">
<?echo $champs[$boucle];?> (Général)</font></b></td>
</tr>
<?
include "connectbd.php";
$sql = "select * from ".$prefixe."_dossiers order by nomdossier";
$resultat = mysql_query($sql);
while($ligne = mysql_fetch_array($resultat)){
$id_dossier = $ligne["id_dossier"];
$nomdossier = $ligne["nomdossier"];
$descriptiondossier = $ligne["descriptiondossier"];
$liendossier = $ligne["liendossier"];
$champs2 = explode ("/", $liendossier);
$boucle2=0;
while ($boucle2 < sizeof($champs2)-1)
{
$boucle2++;
}
$lien = $lienrel."/".$champs2[$boucle2];
$test = eregi("$lien",$liendossier);
if ($test == "1"):
{
?>
<tr>
<td height="12"><font face="Verdana" size="1"> -<?echo("<a style=\"text-decoration: none\" href=%22index.php?Page=administration/$liendossier//"> $nomdossier");?></font></td>
</tr>
<?
}
endif;
}
?>
</table>
</td>
<?
$rep=opendir($dossiercours);
$compteur=0;
while ($file = readdir($rep)) {
if($file != '..' && $file !='.' && $file !=''){
if (is_dir($file)){
$compteur++;
if ($compteur%3!=0):
{
?>
<td width="33%" height="30" valign="top">
<table border="1" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" height="37">
<tr>
<td width="101%" bgcolor="#482B7F" height="13">
<p align="center"><b><font face="Verdana" size="1" color="#FFFFFF">
<?echo("$file");?></font></b></td>
</tr>
<?
include "connectbd.php";
$sql = "select * from ".$prefixe."_dossiers order by nomdossier";
$resultat = mysql_query($sql);
while($ligne = mysql_fetch_array($resultat)){
$id_dossier = $ligne["id_dossier"];
$nomdossier = $ligne["nomdossier"];
$descriptiondossier = $ligne["descriptiondossier"];
$liendossier = $ligne["liendossier"];
$test = eregi("$file",$liendossier);
if ($test == "1"):
{
?>
<tr>
<td height="12"><font face="Verdana" size="1"> -<?echo("<a style=\"text-decoration: none\" href=%22index.php?Page=administration/$liendossier//"> $nomdossier");?></font></td>
</tr>
<?
}
endif;
}
?>
</table>
</td>
<?
}
else:
{
?>
</tr>
<tr>
<td width="33%" height="30" valign="top">
<table border="1" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="101%" id="AutoNumber5" height="36">
<tr>
<td width="101%" bgcolor="#482B7F" height="13">
<p align="center"><b><font face="Verdana" size="1" color="#FFFFFF">
<?echo("$file");?></font></b></td>
</tr>
<?
include "connectbd.php";
$sql = "select * from ".$prefixe."_dossiers order by nomdossier";
$resultat = mysql_query($sql);
while($ligne = mysql_fetch_array($resultat)){
$id_dossier = $ligne["id_dossier"];
$nomdossier = $ligne["nomdossier"];
$descriptiondossier = $ligne["descriptiondossier"];
$liendossier = $ligne["liendossier"];
$test = eregi("$file",$liendossier);
if ($test == "1"):
{
?>
<tr>
<td height="12"><font face="Verdana" size="1"> -<?echo("<a style=\"text-decoration: none\" href=%22index.php?Page=administration/$liendossier//"> $nomdossier");?></font></td>
</tr>
<?
}
endif;
}
?>
</table>
</td>
<?
}
endif;
}
}
}
closedir($rep);
clearstatcache();
?>
<td width="33%" height="30" valign="top"> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
-----SIMNET SA AUTORISE LA MODIFICATION ET REPRISE------