PHP Help

Justin

Legendary Typer
Joined
Jul 2, 2009
Messages
13,882
Reaction score
1
FP$
106
Ok, I wish to add an image to the bottom of my site saying "next".

However, I want it to work like
"If page = index.php the link is = page2.php"
"If Page = page2.php the link is = page3.php"

How would I code that?
 
Try this:

Code:
<?
$page_num = $_REQUEST['pg'];
$page_num += 1;
// Optional check if number is too large or so
if($page_num > MAX)
{
$page_num = 1;
}
elseif($page_num < 0)
{
$page_num = MAX;
}
print '<a href="index.php?pg=' . $page_num . '">Next</a>';
?>
 
Back
Top Bottom