After the user succeed the login we redirect it into the success.php. if any one directly type this url mean we should ask login to see this page, for this purpose we shoul verify the session in each privilaged page with the any php file, in future if modify the session name or value mean that file will help our work simple.
sample code:
//valid.php
<?php
session_start();
if(isset($_SESSION['admin']))
echo "";//echo "Welcome ".$_SESSION['admin'];
else
header("location:index.php");
if($_SESSION['admin']=="out")
header("location:index.php");
?>
0 comments:
Post a Comment