PDA

View Full Version : PHP Code Help



sn1per
03-31-2008, 09:00 AM
Why does $filex return nothing after i use it in my IMG tag after the WHILE and how can i get it to return after the WHILE? I'm stuck.

the file names are like thispicture-photo28.jpg






$perPage = 1;

$page = $_GET['page'];
if (is_numeric($page)) $start=(($page-1)*$perPage);

$handle = opendir ('./');
while (false !== ($filex = readdir($handle))) {
if($filex != "." && $filex != ".." && $filex != basename(__FILE__)) {
$countr++;
if ($countr>$start) {
if ( ($countr-$start)<=$perPage ) {


echo '<center><img src="'.$filex.'"/></center>';

}
}
}
}
$filex= substr($filex, 0, -4);

echo rating_bar($filex, '10') ;

sn1per
03-31-2008, 09:37 AM
ah i figured it out, cause it loops through and yeah ok, got it.

Audio
03-31-2008, 01:21 PM
good job