Logout FormIs logged in already ?Checking |Login Form

If the user already logged in then he will want to logout. In this time session should destroy. Below the code will be used for that purpose.

 

<?php session_start(); session_destroy(); header("location:index.php");// We should give the location of login file. exit(); ?>