<?
session_unset(); //unsets all the variables
if (!$db) {
header("Location: login.php?xc=3112");
exit();
}
$password=$HTTP_POST_VARS['password'];
$login=$HTTP_POST_VARS['login'];
//authentication sql to the dbase
$authsql= "Select *
From users_tour a1 where
(password='$password')
AND (userid='$login')";
$authquery=@mysql_query($authsql);
$authrow=@mysql_fetch_array($authquery);
$authexist=@mysql_numrows($authquery);
$login_id=$authrow[userid];
if ($authexist) {
extract($authrow);
session_start(); //start the session
$authdata=array("login_id"=>$login);
session_register('authdata');
if (!$PHPSESSID) { //register the sessions if there's no sessionid
session_register('login_id');
} elseif (!$login_id) { //if any session variable undeclared, register them!
session_register('login_id');
}
//assigns session variables to the form variables!
$login_id=$login;
} else {
header("Location: login.php?xc=24601");
exit();
} //endif authexist
?>