Hi every one,
I have a page where multiple users log in, do some stuff and get directed to some other pages. Since all of the users use the same function in page1, and they use variables with the same name, I am using sessions so that each user has his own variables, and I pass some of those session variables to the other page for further use. A simplified version of the code looks like this:
page1:
session_start();
session_register("sessVar");
for($i=0;$i<someValue;$i++) {
$sessVar = $i;
echo "\n\t<a href=\"page2.php?choice=$sessVar\">Click</a>";
}
page2:
session_start();
passedVar = $_GET["choice"];
As it is seen, I need to pass the current session variable ONLY when the user clicks on the link. This code works but it is not working properly. If user A and B both log into page1 and both click on the link, both of them have the same passedVar. But this is not good because I need to have different session variables passed to the other page for different users. Can some one please let me know what is the correct way of doing this.
Thanks a lot,
mike.