How can I give authorization to users after a successful login?
This post goes along with my previous post protecting pages from guests.
In My original post I needed to protect certian pages of my site from guests. Well now thanks to "stezz" and "trooper", i can now protect certian pages from guests.
Now the problem is: when a user logs in successfully, I need to grant that user authorization to the protected pages.
I protect the protected pages by:
1) placing a header file (header.inc) at the top of all my html pages, which is shown below.
2) placing
<?php $secure = 1; ?>
at the top of the pages i want to protect.
header.inc
<?php
// First things first, Start the session!
session_start();
?>
<html>
<head>
<title>Welcome! This is the Header</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(!session_is_registered("ID") && $secure) {
?>
<form method="POST" action="login.php">
<font color="#FF0000" size="4">You Must be Logged in to access this page! </font>
<table>
<tr>
<td>Enter your username:</td>
<td><input type="text" size=15 maxlength=30 name="loginUsername"></td>
</tr>
<tr><td>Enter your password:</td>
<td><input type="password" size=15 maxlength=8 name="loginPassword"></td>
</tr>
<tr>
<td><input type="submit" value="Log in"></td>
</tr>
</table>
</form>
<font color="#000000" size="2"><a href="join.php">Click here to Register Free!</a></font>
<?php
exit;
}
?>
Now how should i grant authorization to users that have successfully logged in?
The login script that i am using can be found in my
previous post
I would greatly appreciate any help!
Thank-you!