I have a Login Page that does the following :
{
@$result=@("SELECT * FROM userProfile WHERE userLogin='".$userName."' and userPassword='".$password."'") or die ("error in the sql statement");
@$count=mysql_num_rows(@$result) or die ("Invalid UserName or PassWord");
if(mysql_num_rows(@$result)==0)
{
print "Invalied UserName and PassWord";
die();
}
else
{
$row = mysql_fetch_array($result);
$security_id = $row['userLogin'];
$sess_security_id = $security_id ;
session_register('sess_security_id');
echo ($sess_security_id);
// header("location: welcomeInformation.php") ;
}
All my other pages does the following :
============================================
<?php
session_start();
if( !session_is_registered('sess_security_id') ) {
header("location: index.php "); // send to authentication page ..
}
?>
============================================
Can someone please tell me what is wrong with this code. Even though I get 'sess_security_id' registered I still can't access the other Pages.
awaiting your kind reply !