Page 1 of 1
Log Out Text Button...
Posted: Wed Feb 08, 2006 5:21 pm
by No0b
I need some help with my php script. What i'm trying to do is have a clickable text that when clicked "onMouseClick" it logs out of your session. What I was thinking of doing was making a text that had the onMouseClick event that equals "$_SESSION[logged] = "" " but i don't know if it'll make the $_SESSION super = nothing and i don't know how to make a text clickable without making it a link. If there is any other way of making a log out text that makes the session end or the super ($_SESSION[logged]) eqaul nothing. I perfere the $_SESSION super global way but if there's a better way then that's best.
Thanks for reading and all help is appreciated.

Posted: Wed Feb 08, 2006 5:43 pm
by nickman013
why do you want it onclick?
i think it is better to kill the session on a logout page.
Posted: Wed Feb 08, 2006 5:49 pm
by No0b
be cuz onclick is one of the only ways i could of thinked of instade of making a whole new page. and another thing is that i want it to refresh the page and if the page needs session access then it'll do it's thing.
If i made a whole page for loging out then i don't know i guess it's good. just andy suggessions are good just need it to log out when you click the text how ever any one else does this is good enough.
Posted: Wed Feb 08, 2006 6:26 pm
by nickman013
thats stupid though. just make a logout page with a header() so it redirects automatically to the login form or where ever you want.
Posted: Wed Feb 08, 2006 6:41 pm
by raghavan20
this should help...
Code: Select all
if (isset($_GET["action"])){
if ($_GET["action"] == "logout"){
unset ($_SESSION["logged"]);
header ("Location: index.php");
}
}
<a href = 'login.php?action=logout'>Log Out</a>