click link and set session on next page?

Baseballxrq

New Member
Hi i am struggling a bit with this, basically i have a site with other users on, i am trying to get a link so that when one user clicks the link to go to another users profile it will take them to that users profile, this bit works fine, but what i am also wanting to do is echo out a session onto the users profile that they have clicked, so my question is can i add onto my existing link somewhere a way of carrying an echo over to profile.php where i can then store my session execute the session variable without getting rid of the profile id which is already being echoed?so to elaborate on the home page have the link in mysql:\[code\]<?php $online_channel_set = online_channel(); while ($online = mysql_fetch_array($online_channel_set)) { echo "<div class=\"online_row\"> <a href=http://stackoverflow.com/"profile.php?id={$online['user_id']}\"><img width=25px height=25px src=http://stackoverflow.com/"data/photos/{$online['user_id']}/_default.jpg\" class=\"online_image\"/><div class=\"online_text\">{$online['display_name']}</div></a> </div>";?> <? } ?>\[/code\]and then on profile.php i would have my session variable like so:\[code\] <? session_start(); if(isset($_SESSION['message'])) echo $_SESSION['message']; unset($_SESSION['message']); ?>\[/code\]could i perhaps just add a second echo in the script like so:\[code\]<a href=http://stackoverflow.com/"profile.php?id={$online['user_id']}?message={$row['message'];">link</a>\[/code\]
 
Back
Top