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! Link to comment https://forums.phpfreaks.com/topic/57614-solved-click-2-log-out/ 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 Link to comment https://forums.phpfreaks.com/topic/57614-solved-click-2-log-out/#findComment-285170 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. Link to comment https://forums.phpfreaks.com/topic/57614-solved-click-2-log-out/#findComment-285180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.