1. Is logged in already ?CheckingLogin Form|Logout Form

First we should check the session. If the user already logged in.

otherwise user redirect to login page.

 

<?php if (!isset($_SESSION['userid'])) { echo “You are not Logged In If you want to Login”; ?> <a href="login.php">Click me</a> </td></tr></table> <?php exit; } ?>