Thanks for reading and all help is appreciated.
Log Out Text Button...
Moderator: General Moderators
Log Out Text Button...
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.

Thanks for reading and all help is appreciated.
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
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.
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.
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
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>