Hi,
I am creating PHP script for browsing some database. But there is a lot of varibles (position, orderby, order:asc,desc etc.).
So I have to set them in every link (prev, next, begin, end...).
I thought, it will be better with sessions ---> I will set only SID in links.
But I found a problem when I wanted to change any variable in link.. Look at this example:
-----test.php (simplified):----
echo $orderby; //echo 1
session_start();
echo $orderby; //echo 2
if (!isset($orderby)) {
$orderby = 1; //default
session_register("orderby");
}
.
.
.
.
//when I want normal link
<a href="test.php?SID>xxx</a>
//and when I want to change $orderby
<a href="test.php?orderby=1">xxx</a>
<a href="test.php?orderby=2">yyyy</a>
But when I click yyy, in echo 1 it writes "2", but in echo 2 it writes "1" again... So the $orderby is not set, it was overwritten by the session variable.
What should I do to change it?
Thanks for help...
Petr