Hi,
Thanks for everyone who answered my previous questions. In order to make my pages secure I decided to use $HTTP_SESSION_VARS.
On the login page I have the following lines:
if ($submit) #if the submit button is pressed
#"$felhasznalo" > username, "$jelszo" > password
the table jelszavak contains the usernames & passes
{
$query = "select felhasznalo,jelszo from jelszavak
where (felhasznalo = '$felhasznalo') && (jelszo = '$jelszo')" ;
$result = mysql_query($query,$db) ;
if (!$result)
{
echo "<h4>Hiba az azonosító és jelszó ellenõrzésénél!</h4>" ;
}
$num = mysql_num_rows($result) ;
if ($num == 1)
{
session_start() ;
#this variable is supposed to store
#whether someone is logged in or not (1 or 0)
$HTTP_SESSION_VARS["bejelentkezve"] = 1 ;
if ($felhasznalo == "admin")
{
header("Location: admin_menu.php") ;
}
else
if ($felhasznalo == "dolg")
{
header("Location: dolg_menu.php") ;
}
}
else
{
header("Location: login.php") ;
}
}
On all the target pages there are the following lines:
<?
session_start() ;
if (!$HTTP_SESSION_VARS["bejelentkezve"])
{
header("Location: login.php") ;
}
The login worked pretty well before I made this change. Since I have this check for each page using $HTTP_SESSION_VARS I can't even log in any of the users. Please someone help me! This authetication drives me crazy!
Thanks a lot!
Akos, Hungary