I have this simple while loop which retrieves data from a mysql query and displays several links on my homepage.
I would like to avoid using the php get function and add query strings to my urls
I am thinking of using session variables but I need help and I'm pretty sure this can't be done.
When a visitor clicks a link from the several ones displayed by the while loop, that particular variable would be set in a session.
In my code, the session will always send the last var
Can this be done?
<? session_start(); // Start Session Variables
$result = mysql_query("my query");
while($slice = mysql_fetch_assoc($result)){
$url = $slice['url'];
$name = $slice['name']; ?>
<a href="<? echo $url; ?>"><? echo $name; ?></a>
<? }
$_SESSION['name'] = $name; // Store session data ?>