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.
Pingback: XkiD | PHP Tutorial : Membership script - Users Logout | blog.xkid.ro