TheFilmGod Posted June 28, 2007 Share Posted June 28, 2007 I finished making a log in script. Mainly because I got help from this forum! How can I make a link to log out? One click and the current page is refreshed but the person is logged out? I don't want the person to be redirected to another page to just log out. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 28, 2007 Share Posted June 28, 2007 You could use $_GET to do this <?php $logout = $_GET['logout']; if($logout == 1) { session_destroy(); header("Location: nlah.php"); } ?> <a href="yourpage.php?logout=1">Logout</a> This is mearly an example, dont actually use this code ~ Chocopi Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted June 28, 2007 Author Share Posted June 28, 2007 Thanks. I decided to just have them directed to a page where they are logged out. I figured it would be more easier and a bit more secure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.