Bug #16102 Updated: >1 session variables not getting set correctly
| From: | yohgaki@php.net | Date: | Sat, 16 Mar 2002 05:06:27 +0000 |
| Subject: | Bug #16102 Updated: >1 session variables not getting set correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2636@lists.php.net to get a copy of this message | ||
ID: 16102
Updated by: yohgaki@php.net
Reported By: martin_jones@bigfoot.com
-Status: Open
+Status: Analyzed
Bug Type: Session related
Operating System: Windows 2000/XP
PHP Version: 4.1.2
New Comment:
This will be fixed in 4.2.0, probably.
Previous Comments:
------------------------------------------------------------------------
[2002-03-15 23:39:48] webdevguy1@yahoo.com
I am having a similar problem. It seems that POST variables are not
getting set. It works in 4.1.1, and in the version of 4.1.2 available
at http://www.zend.com/zend/week/week77.php,
but not in 4.1.2 from
http://www.php.net/downloads.php, nor in the version
of 4.1.2 available
from http://www.php4win.com/builds/latest-build.php.
------------------------------------------------------------------------
[2002-03-15 14:52:17] martin_jones@bigfoot.com
The script below works fine on PHP 4.1.1, but fails on 4.1.2.
The script sets two session variables. Only the most recent variable
seems to get set, with the previous variable getting reset.
-----Script-----
<html>
<body>
<?php
session_start();
$varTest1 = "";
$varTest2 = "";
session_register("TEST1");
session_register("TEST2");
if (isset($_POST['TEST1'])) {
$varTest1 = $_POST['TEST1'];
$_SESSION['TEST1'] = $_POST['TEST1'];
}
if (isset($_POST['TEST2'])) {
$varTest2 = $_POST['TEST2'];
$_SESSION['TEST2'] = $_POST['TEST2'];
}
if (!isset($_SESSION['TEST1'])) {
$_SESSION['TEST1'] = "NOT SET";
}
if (!isset($_SESSION['TEST2'])) {
$_SESSION['TEST2'] = "NOT SET";
}
foreach ($_SESSION as $varKey=>$varValue) echo "$varKey =>
$varValue</br>";
?>
<form action="sesstest.php" method="POST">
<?php
if (isset($_POST['SUBMIT1'])) {
?>
<input type="text" value="<?php echo $varTest1; ?>"
name="TEST1">
<input type="SUBMIT" name="SUBMIT" value="Form1">
<?php
} else {
?>
<input type="text" value="<?php echo $varTest2; ?>"
name="TEST2">
<input type="SUBMIT" name="SUBMIT1" value="Form2">
<?php
}
?>
</form>
</body>
</html>
------Script End-------
The script should be saved as sesstest.php
The modules configured are GD and XSLT
If you need more information, please contact me.
--
Martin
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16102&edit=1