hughesmallard
New Member
Please can someone help me with this. I have this MySQL query which lists users on my site, and echos a link that can be clicked to take you to the user's profile:\[code\]<?php $online_set = online_channel(); while ($online = mysql_fetch_array($online_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\]The link goes to profile.php and echos the users 'user_id' so it knows which users profile to take you to, and now I am wanting to include a session variable in the link somehow so a message is displayed on that users profile after clicking the link.I have tried including \[code\]$_SESSION['chat']\[/code\] in the link but it doesn't work:\[code\] <?php $online_set = online_channel(); while ($online = mysql_fetch_array($online_set)) { echo "<div class=\"online_row\"><a href=http://stackoverflow.com/"profile.php?id={$online['user_id']}{$_SESSION['chat']}\"><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\]I am also trying to execute the session in profile.php by using this:\[code\]<?session_start();if(isset($_SESSION['chat'])) echo $_SESSION['chat']="<div class=\"infobox-favourites\"><strong>Deleted from Favourites</strong> - This user has successfully been deleted from your favourites.</div><div class=\"infobox-close4\"></div>"; unset($_SESSION['chat']);?>\[/code\]What I have tried is not working and i'm not sure i'm doing it right, so I would really appreciate any help with this. Thanks