Hello and welcome to our community! Is this your first visit?
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
    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:
    $_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-17-2010 at 12:47 AM. 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