MLM(Multi Level Marketing) Website Using PHP - Binary Plan

Part 7 - Create Logout

In this tutorial, we will create a logout script. So that user can log out of his account. When logging out, you need to destroy all sessions, so that next time user needs to log in again with his/her user id and password.

  • Create a page logout.php.
  • Copy and paste the below code to this.



logout.php

<?php
session_start();
session_destroy();
echo '<script>alert("Logout Success");window.location.assign("index.php");</script>';
?>                        


1284