Blah i should have been able to work that our myself
anyway this should work, although i havnt tested it.
code:
<?
$num = $_GET['num'];
if(!isset($_GET['num']) OR $num < 1){ //If the input is less than one correct it
$num = "1";
}
?>
<img src="http://www.hobbes.weirdfish.net/strips/strip<?echo $num;?>.jpg" alt="strip<?echo $num;?>.jpg error">
<?php
//first we count the files in the strips
$files = scandir("strips");
$fileno = count($files) - 2;//ignore the . and .. entries
if($num != $fileno){//If we are on the last line dont echo a link other wise do
echo "<a href=\"http://hobbes.weirdfish.net/strip.php?num=" . $num+1 . "\">Foward</a>";
}
if($num > 1){ //check to see if the number is greater than one, if so echo the back link
echo "<a href=\"http://hobbes.weirdfish.net/strip.php?num=" . $num-1 . "\">Back</a>";
}
//other wise just dont echo anything
?>
But as ash said you should try and work these things out for yourself.
http://www.php.net will become your bibble