Jump to content

[SOLVED] Click 2 Log Out?


TheFilmGod

Recommended Posts

I finished making a log in script. Mainly because I got help from this forum!  ;D

 

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.