When I load my page for the first time, it is from the following link:
www.profile.php?id=99
(the id=99 comes from id=$id, whereby $id is previously set)
The profile.php script starts with:
if ($_GET['id']) {
$id = $_GET['id'];
} else if ($_GET['sid']) {
$id = $_GET['sid'];
} else if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
} else {
echo "something went wrong";
exit();
}
Later on in the code, I have two links that are echoed on the page:
$nextLink = "<a href='http://profile.php?page=$nextPage&?sid=103'>Next</a>";
$prevLink = "<a href='http://profile.php?page=$prevPage&?sid=103'>Prev</a>";
(the sid=103 comes from sid=$id, whereby $id is previously set)
Now for some reason, when either of these links is clicked, the part of my script:
else if ($_GET['sid'])
is getting ignored, and it defaults to the next line of code:
else if (isset($_SESSION['id']))
Any suggestions as to what is going on? I hope I provided enough info....