Hi, I'm new to this forum, and it was suggested to me since there are many helpful people around I think i'm not the first one posting this kind of thread, but even though i surfed the net, did exactly how other suggested to identify the problem, it looks like i can't make this sessions work.
on the first page where i declare the session i tested it with the print command and the value appears to be correct. as soon as i go on the second page the value of the session is null
I tried it on 2 different servers and i got the same problem. can please someone help me coz i'm stack on my project here
BELOW ARE THE CODED I'M USING:
____________________________________________________________
LOGIN VERIFICATION PAGE
<?
session_start();
(HERE I HAVE THE CONENCTION TO DB CODE AND VERIFICATION OF THE UN and PW - which are working fine)
if($count==1)
{
$_SESSION[auth]= 'TRUE';
$test=$_SESSION[auth];
print "$test";
header("location:test.php");
}
else {
echo "Wrong Username or Password";
header("location:login.html");
}
?>
____________________________________________________________
THIS IS THE CODE FOR THE PAGE I WANT ONLY LOGGED IN USERS TO BE ABLE TO VIEW (BELOW)
<?php
session_start();
if(isset($_SESSION['auth']) == 'TRUE')
{
echo ("YES");
}
else
{
echo ("NO");
}
?>
____________________________________________________________
I would really appriciate any help. THANKS
on the first page where i declare the session i tested it with the print command and the value appears to be correct. as soon as i go on the second page the value of the session is null
I tried it on 2 different servers and i got the same problem. can please someone help me coz i'm stack on my project here
BELOW ARE THE CODED I'M USING:
____________________________________________________________
LOGIN VERIFICATION PAGE
<?
session_start();
(HERE I HAVE THE CONENCTION TO DB CODE AND VERIFICATION OF THE UN and PW - which are working fine)
if($count==1)
{
$_SESSION[auth]= 'TRUE';
$test=$_SESSION[auth];
print "$test";
header("location:test.php");
}
else {
echo "Wrong Username or Password";
header("location:login.html");
}
?>
____________________________________________________________
THIS IS THE CODE FOR THE PAGE I WANT ONLY LOGGED IN USERS TO BE ABLE TO VIEW (BELOW)
<?php
session_start();
if(isset($_SESSION['auth']) == 'TRUE')
{
echo ("YES");
}
else
{
echo ("NO");
}
?>
____________________________________________________________
I would really appriciate any help. THANKS