Jas
05-12-2007, 07:03 PM
Okay, as the topic says, I am having a problem with the SESSION thing-a-ma-jig. . .
I can get the session to set with no error messages, the cookie on the comp points to the correct session (of course) , and when I "print $_SESSION['username'];" it works fine. However, when I go to another page and try to bring up the info. . . . NOTHING.
Here is the part of the code in question:
#--------------page one-------------------
<?php
# . . . . . . MySQL_query. . . .
SESSION_START();
$S1 = $row['username'];
$S2 = $row['password'];
$S3 = $row['accesslevel'];
$S4 = $row['webstatus'];
$_SESSION['username'] = $S1;
$_SESSION['password'] = $S2;
$_SESSION['accesslevel'] = $S3;
$_SESSION['webstatus'] = $S4;
print '<a href="./settings/test.php">CLICK ME</a>';
?>
#----------------Page two---------------
<?php
if ($_SESSION['username'] == 'Jas'){
print 'hi';
}else{
print 'bye';
}
print $_SESSION['username'];
print $_SESSION['password'];
print $_SESSION['accesslevel'];
print $_SESSION['webstatus'];
?>
Page two is just a test, but you get the picture. The second page does not pull up the info. Anyone know why?
I can get the session to set with no error messages, the cookie on the comp points to the correct session (of course) , and when I "print $_SESSION['username'];" it works fine. However, when I go to another page and try to bring up the info. . . . NOTHING.
Here is the part of the code in question:
#--------------page one-------------------
<?php
# . . . . . . MySQL_query. . . .
SESSION_START();
$S1 = $row['username'];
$S2 = $row['password'];
$S3 = $row['accesslevel'];
$S4 = $row['webstatus'];
$_SESSION['username'] = $S1;
$_SESSION['password'] = $S2;
$_SESSION['accesslevel'] = $S3;
$_SESSION['webstatus'] = $S4;
print '<a href="./settings/test.php">CLICK ME</a>';
?>
#----------------Page two---------------
<?php
if ($_SESSION['username'] == 'Jas'){
print 'hi';
}else{
print 'bye';
}
print $_SESSION['username'];
print $_SESSION['password'];
print $_SESSION['accesslevel'];
print $_SESSION['webstatus'];
?>
Page two is just a test, but you get the picture. The second page does not pull up the info. Anyone know why?