Web Development Tips and Tricks

Web Development Tips and Tricks

Tuesday, March 15, 2011

Login denied

If a user not login and try to open page

< ? php
session_start();

if (!$_SESSION["userid"])
{
// User not logged in, redirect to login page
header("location: index.php");
}
?>

Copy and paste above code on every page of your webapplication :)

No comments:

Post a Comment