PHP Tutorial : Membership script – Users Logout

Final step and the most easiest part is now users logging out. Just build a page called logout.php and put a link to it everywhere you want to give the option to users to logout & here’s the function:

<?php
function logoutUser() {
session_unset();
session_destroy();
header("Location: homePage.php");
exit();
}
//here's how you put it in action


logoutUser();
?>

Extraordinary,

Now you know how to build a complete membershipt script/site with php including registering module, logiging in & check this thing, and of course users logout module.

This entry was posted in Complete Scripts and tagged , , , . Bookmark the permalink.

One Response to PHP Tutorial : Membership script – Users Logout

  1. Pingback: XkiD | PHP Tutorial : Membership script - Users Logout | blog.xkid.ro

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>