Hi every one,
I have a page where multiple users log in and do some stuff and get directed to some other pages.
I am using sessions for each user, so that when each user clicks on a link, a couple of variables for that specific user, registered in his session, are passed to the other page as well. 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<td><a href=\"newPage.php?passed=$SessVar\">Click Here</a>";
}
</CODE>
page2:
session_start();
passedVal = $_GET["passed"];
As it is seen, I need to pass the current value of session variable only when the user clicks on the link. This code works but if two users A and B both click on the link of page 1, both have the same passedVal in page 2, even if user A uses a session and user B does not use a session.
Could some one tell me how could I pass session variables via links, and how should I retrieve them in other page so that each user has his own variables(we have multiple users each of which with the variables of the same name).
Thanks a lot,
mike.
I know that I can access session variables on different pages, but the problem is that I need to pass session variables to the other page only if the user clicks on the link because the values of passing session variables are changing(in a while loop)e middle of the while loop the user clicks on a link, then The reason is that I haesome information about that specific user to the