Okay, i have a logout script. It's Shown below...
<?php
include 'include.inc';
// This will logout a user
set_error_handler("errorHandler");
// restore the session
session_start();
// Is the user logged in
if (session_is_registered("loginUsername"))
session_unregister("loginUsername");
else
{
// Register a message to show the user
session_refister("message");
$message = "Error: You Are Not Logged In!";
}
// redirect the browser back to the calling page
if(session_is_registered("referer"))
{
// Delete the redirection session variable
session_unregistered("referer");
// Then, use it to redirect to the calling page
header("Location: $referer");
exit;
}
else
header("Location: index.html");
?>
How can i trigger the script by using a simple html Button, So that users can logout of their account by simply clicking the Button?
All help Is appriciated! Thank-you!