otuatail Posted November 18, 2007 Share Posted November 18, 2007 I found that I can't set a session variable on a previouse page. CODE: <? session_start(); $_SESSION['member'] = "2"; header('Location: board.php'); ?> If I set it on board.php it is OK. Has this got something to do with header() ? Desmond. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 18, 2007 Share Posted November 18, 2007 keep this in one page <?php session_start(); $_SESSION['member'] = "2"; header('Location: board.php'); ?> and keep this in board.php <?php session_start(); echo $_SESSION['member']; ?> it echoed 2 for me Quote Link to comment Share on other sites More sharing options...
otuatail Posted November 18, 2007 Author Share Posted November 18, 2007 I have done and it dosn't work. I have done exactly that. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 18, 2007 Share Posted November 18, 2007 Show your code. It is working for me. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted November 18, 2007 Share Posted November 18, 2007 When learning, developing code, or debugging code, always check your web server log for errors and/or turn on full php error reporting. If this is on your development system it is likely that the tmp folder that php is storing the session data files in either does not exist or does not have the proper permissions. It is also possible that the .php files have been saved as UTF-8 or Unicoded files and are outputting the language encoding characters before the <?php tag. In either case, an error will be logged to help you pin down what the problem is. 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.