denoteone Posted January 28, 2009 Share Posted January 28, 2009 what is the the snytax to compare a session varible to "yes" if($_session['all_in_na']!= 'yes'){ header("Location: index.php"); } so if the session is not equal to yes then go to index.php Quote Link to comment Share on other sites More sharing options...
.josh Posted January 28, 2009 Share Posted January 28, 2009 if($_SESSION['all_in_na'] == 'yes') { // your variable equals 'yes' do something } if($_SESSION['all_in_na'] != 'yes') { // your variable does not equal 'yes' do something } Quote Link to comment Share on other sites More sharing options...
ilikemath2002 Posted January 28, 2009 Share Posted January 28, 2009 <?php if($_SESSION['all_in_na']!= 'yes'){ header("Location: index.php"); } else { header("Location: xxx.php"); ?> Quote Link to comment Share on other sites More sharing options...
.josh Posted January 28, 2009 Share Posted January 28, 2009 the problem is that the session in $_session is not capitalized. It is case sensitive, needs to be $_SESSION. Quote Link to comment Share on other sites More sharing options...
ilikemath2002 Posted January 28, 2009 Share Posted January 28, 2009 the problem is that the session in $_session is not capitalized. It is case sensitive, needs to be $_SESSION. Oh let me fix that. I'm just a newb who doesn't help a lot xD. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.