Hi! 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] <?php // Start session handling session_start(); // Check login if (isset($HTTP_SESSION_VARS["xyz"]) and $HTTP_SESSION_VARS["xyz"] == "yes") { ?> <html> [page contents] </html> <?php } 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? Thanks /lasso -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php