ID: 20583 Comment by: charlesk at netgaintechnology dot com Reported By: jseverson at myersinternet dot com Status: Open Bug Type: Session related Operating System: RedHat 7.2 PHP Version: 4CVS-2002-11-22 (stable) New Comment:
I forgot the session_start(); Still the same behaviour <?php session_start(); $a = 4; $test = $_SERVER["HTTP_REFERER"]; $_SESSION["test"] = $test; $y = 3; $t = 2; $a = 5; echo "$a $t $y"; ?> Output : 5 2 3 <?php session_start(); $a = 4; $test = $_SERVER["HTTP_REFERER"]; session_register("test"); $y = 3; $t = 2; $a = 5; echo "$a $t $y"; ?> Output: 5 2 2 Previous Comments: ------------------------------------------------------------------------ [2003-02-26 16:04:14] charlesk at netgaintechnology dot com The first one works, the second one does not. <?php $a = 4; $test = $_SERVER["HTTP_REFERER"]; $_SESSION["test"] = $test; $y = 3; $t = 2; $a = 5; echo "$a $t $y"; ?> <?php $a = 4; $test = $_SERVER["HTTP_REFERER"]; session_register("test"); $y = 3; $t = 2; $a = 5; echo "$a $t $y"; ?> If this is buggy code please tell me how. I ended up going through _EVERY_ site that we host and changing session_register to $_SESSION. Charles Killmer Windows 2000 Server IIS 5.0 PHP 4.3.1 ------------------------------------------------------------------------ [2003-02-09 16:38:22] phpbugs at brianmertens dot com Maybe this is related to the bug #22117 , that I reported yesterday? http://bugs.php.net/bug.php?id=22117 ------------------------------------------------------------------------ [2003-02-04 13:05:49] jseverson at myersinternet dot com Just wanted to check in on this bug and see if any progress has been made...thanks. ------------------------------------------------------------------------ [2003-01-27 17:45:14] jseverson at myersinternet dot com Ok, sorry, I didn't realize we weren't allowed to use Oracle in our samples. Can you please follow these steps then to reproduce the bug: 1. Copy and paste the following code into a file, save file with .php extension. _______________________________________________________ <?php session_start(); $r = $HTTP_REFERER; echo "<h2>PHP 4.3.0 BUG</h2>"; echo "<p>r is "; var_dump($r); $w = "hello"; session_register( "r" ); $x = "bananas"; $y = 5; $z = 777; echo "<p>w is " . $w . " (should be \"hello\")\n"; echo "<p>x is " . $x . " (should be \"bananas\")\n"; echo "<p>y is " . $y . " (should be 5)\n"; echo "<p>z is " . $z . " (should be 777)\n"; ?> ________________________________________________________ 2. Open up the file you just saved in a web browser, copy the url in your browser, and then close the browser. (Goal is to make sure $HTTP_REFERER is null.) 3. Open up a clean browser, and paste the url to that file location and press enter. 4. You should see the weird assignment statements there. Just so you can see what my browser said, here is my output: PHP 4.3.0 BUG r is NULL w is hello (should be "hello") x is 777 (should be "bananas") y is 777 (should be 5) z is 777 (should be 777) Thanks, and sorry for not providing a short, complete, self-contained sample script earlier. I misunderstood the definition of short, complete, self-contained script. ------------------------------------------------------------------------ [2003-01-27 17:35:48] [EMAIL PROTECTED] So far every script in this report is buggy and can't possibly work. So fix your scripts first. Self-contained means that they can be run anywhere, regardless if there is oracle available or not. (ie. get rid of the oracle stuff in it) Short means it's less that 15 lines. Complete means it's all there, between <?php and ?> tags. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20583 -- Edit this bug report at http://bugs.php.net/?id=20583&edit=1