bug or bad definition ?

From: Date: Thu, 31 Jan 2002 10:21:51 +0000
Subject: bug or bad definition ?
Groups: php.general 
Request: Send a blank email to php-general+get-82900@lists.php.net to get a copy of this message
Hello, can someone test this code and send me results ? <? function check_session() { global $_SESSION; session_start(); if (isset($_SESSION["id"])) return true; else { unset($_SESSION); session_destroy(); return false; } } $sess = check_session(); if (isset($_POST["button"]) && !$sess) { session_start(); $_SESSION["id"] = 1; $_SESSION["name"] = "name"; header("location: http://www.php.net/"); exit(); } ?> ?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>XXX</title> </head> <body> <form action="<? echo $_SERVER["PHP_SELF"]; ?>" method="post"> <input type="submit" name="button"> </form> </body> </html> i want to know if apache fails (returns no response) or if it passed. And then try please again but with this line in function: //global $_SESSION; # disable global Thank you Lampa

« previous php.general (#82900) next »