I'm including my code below. Whenever i click on the "next" link it laggs and never seems to change the page or connect when passing teh variable...
It's a simple page that i'm using to debug another bigger page but i can't seem to figure out what the problem is. I'm on win98/php4rc2/apache 1.3.9. Every other php works... Actually the other page where i have simliar code(as far as reading a directory) works too so i'm lost? :/
any help would be appreciated
-cisk
-------
<?
$PHP_SELF = getenv("PHP_SELF");
$picPath = "C:WINDOWSDesktopwebpagesdjcisktry1piximagesgirls";
$d = dir($picPath);
$imgs = array();
$numImgs = 0;
while($file = $d->read()) {
if($file[0] != "." && eregi(".jpg$|.gif$|.png$", $file)) {
$imgs[$numImgs] = $file;
$numImgs++;
}
}
/* find previous place */
if(!isset($imgPlace) | | $imgPlace = "")
$imgPlace = 0;
?>
<html>
<head>
<title>Picture viewer</title>
<body>
<?
/* display links */
$counter = 1;
for($i = $imgPlace; $i < $numImgs; $i++) {
if($counter <= 10) {
printf("%d. <a href="%s%s">%s</a>n<br>n", $i+1, $picPath, $imgs[$i], $imgs[$i]);
$counter++;
}
}
$oldPlace = $imgPlace;
$imgPlace = $counter;
printf("<br>Counter: %d<br>nn", $counter);
if(!$oldPlace == 0) {
printf("<a href="%s?imgPlace=%s">back</a>n", $PHP_SELF,$oldPlace);
}
printf("<a href="%s?imgPlace=%s">next</a>n", $PHP_SELF, $imgPlace);
$d->close();
?>
</body>
</html>