I've run across a problem when using session_start and HTTP headers in 
Mozilla. I'm trying to write a snippet of code that checks whether a 
user has logged in or not. If the user has a session variable set I want 
to display the page and if he or she hasn't I want to give them a 403 
Forbidden header. My current code looks like this:

[top of page]
// Start session handling

// Check login
if (isset($HTTP_SESSION_VARS["xyz"])
        and $HTTP_SESSION_VARS["xyz"] == "yes") {
[page contents]
else {
        header("HTTP/1.0 403 Forbidden");
[end of page]

This works perfectly in IE 6 (I get a 403 Error Message) but in Mozilla 
I just get an empty page (containing just the <html> and <head> tags). 
Most other headers seem to work though.
If I use header("Location: somepage.php") both Mozilla and IE correctly
redirects the browser. I don't know if it's a bug in IE or Mozilla or if 
  I'm plain stupid, but perhaps someone else has experienced this and 
are willing to give me a hint?



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to