Hello,
I'm trying to restrict access to some parts of my site, I have created authentiaction levels using PHP and Mysql, but its still possible for users to circumvent the system, by typing the URL, I want people who does this to redirected to another page. Any one knows how to do this?
Thanks in advance
User Authentication using PHP4 and Apache
Moderator: General Moderators
use cookies with session 
Code: Select all
/// example
<?
// Check if the cookies are set
// This removes some notices (undefined index)
if (isset($_COOKIE['USERNAME']) && isset($_COOKIE['PASSWORD']))
{
// Get values from superglobal variables
$USERNAME = $_COOKIE['USERNAME'];
$PASSWORD = $_COOKIE['PASSWORD'];
$security = new auth();
$check = $security->docheck($USERNAME, $PASSWORD);
}
else
{
$check = false;
}
if ($check == false)
{
do something here....
// include that on the pages which you want to protect