User Logout Message
Posted: Fri Jun 24, 2011 1:13 pm
Hi there, I'm new to php development, and I need some assistance. I've created a login that uses the SESSION superglobal to authenticate the user. When the user logs in they are greeted by a message that includes their username. I do this through a function I created:
The function works perfectly when the user logs in. However this is not the case when the user logs out. I would like to be able to have another message telling the user that they have logged out successfully with their username included in the message. This is difficult because I have already destroyed the session, therefor my function that calls the session in question no longer exists.
If anyone has any ideas or a work around, I would be very grateful. Thank you.
Code: Select all
function session_text($session_text_input) {
$sql = "SELECT * FROM users WHERE uid = " . $_SESSION["uid"];
$result = mysql_query($sql);
$array = mysql_fetch_array($result);
print_r ($array["$session_text_input"]);
}
If anyone has any ideas or a work around, I would be very grateful. Thank you.