wrong code
Posted: Wed Feb 15, 2006 7:35 pm
hi, i no very little about php.
idcarro =17
and there are fotos in the pic directory that start with n17.
can anybody give a quick look at this code and tell me why i'm getting echoed a simple "."? thx!
EDIT: atually, only on the third i increment i start getting the file names...
Code: Select all
<?PHP
$id=$_REQUEST['idcarro'];
$st="n".$id;
$dir = "./pics/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$i=0;
while (($file = readdir($dh)) !== false)
{
if ( strpos($file,$st) == 0 )
{
$rString .= "&pic".$i."=".$file."&";
$i++;
}
}
closedir($dh);
}
}
echo $rString;
?>and there are fotos in the pic directory that start with n17.
can anybody give a quick look at this code and tell me why i'm getting echoed a simple "."? thx!
EDIT: atually, only on the third i increment i start getting the file names...