Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    58
    Thanks
    8
    Thanked 4 Times in 4 Posts

    Session before header.

    Ok, So I am trying to make a script that makes sure users are logged in when viewing the page, and if not, send them to the home page, and send a session variable with a code for a message that tells them they must be logged in. However this is not working

    PHP Code:
    if(!checkSessions()){
        
    $_SESSION['mcode'] = 3;
        
    header('Location: game.php?side=news');

    If I take out the header then the code works, however on the other page, when I try to out put all session variables to check for it. It shows it is 0, not three as it should be. Can anyone help me out here?


    I found the issue, thank you all who read.
    Last edited by Rihoj; 01-16-2010 at 11:47 PM. Reason: Found the issue


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •