John_Saunders
11-24-2002, 06:21 PM
I am going to put a personal photo album online and I have my links to the different photos/descriptions using the method below. How can I add a "Next" link to the bottom of every description instead of only having the link off the thumbnail?
<?php
// If the $_GET['id'] is not here, you will get an error, so check
if(!isset($_GET['id'])) $_GET['id'] = "";
$page[] = "1";
$page[] = "2";
// check to see if it is valid.
if(!in_array($_GET['id'], $page)) $_GET['id'] = "";
// do the stuff
switch($_GET['id']) {
case "1":
include("photo1.php");
break;
case "2":
include("photo2.php");
break;
default:
include("photo1.php");
break;
}
?>
I would like to make it so I can add the link at the bottom and it will automatically put the link to id=2 if you're on id=1 and so on. How can I make it so if a visitor is on the last photo or id=20, it will know not to print the "Next" link since there is no id=21?
Any help would be greatly appreciated.
John
<?php
// If the $_GET['id'] is not here, you will get an error, so check
if(!isset($_GET['id'])) $_GET['id'] = "";
$page[] = "1";
$page[] = "2";
// check to see if it is valid.
if(!in_array($_GET['id'], $page)) $_GET['id'] = "";
// do the stuff
switch($_GET['id']) {
case "1":
include("photo1.php");
break;
case "2":
include("photo2.php");
break;
default:
include("photo1.php");
break;
}
?>
I would like to make it so I can add the link at the bottom and it will automatically put the link to id=2 if you're on id=1 and so on. How can I make it so if a visitor is on the last photo or id=20, it will know not to print the "Next" link since there is no id=21?
Any help would be greatly appreciated.
John