php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18251 Lost variables from post action
Submitted: 2002-07-09 15:43 UTC Modified: 2002-11-29 14:20 UTC
From: jazar at zacks dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.1.2 OS: WindowsXP, Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jazar at zacks dot com
New email:
PHP Version: OS:

 

 [2002-07-09 15:43 UTC] jazar at zacks dot com
I use simple POST action. Some time (the same post) PHP variable gets the value, some time it doesn't. I am using the same post action from the same page. Looks like some PHP bug, or what?
The same thing with diffrent kinds of browsers... I have a big list of users with different OS and browsers

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-09 15:51 UTC] jazar at zacks dot com
I don't use $_POST['foo'] or $HTTP_POST_VARS['foo']
Only simple $foo variable
 [2002-07-09 17:39 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2002-07-09 17:45 UTC] jazar at zacks dot com
I tried before, we had a lot of GD support problems in PHP 4.2
This is the reason we use of 4.1.2
 [2002-07-09 18:02 UTC] sniper@php.net
Is register_globals=On in your php.ini?

 [2002-07-09 18:03 UTC] jazar at zacks dot com
yes
 [2002-07-09 18:04 UTC] jazar at zacks dot com
I meet this problem 1/100 (aproximetly) post actions
 [2002-07-09 18:08 UTC] sniper@php.net
Update to 4.2.1. If this happens with it too, then reopen 
this report.

 [2002-11-28 14:00 UTC] sk at pilonet dot de
My problem might be affected by this bug.

I'm using PHP 4.2.3 (sapi) on Windows 2000 Server running Apache 1.3.27 as Webserver. 
My form:
<form action="/test.php" name="test" method="post">
  <input type="text" name="start" size="20" maxlength="20" value="100">
  <input type="submit" name="submit" value="Speichern">
</form>

Then I'm dumping $_POST, where the following happens:
When input was an integer from 1-999 it is displayed correctly. From 1000 on the corresponding post value is "false". Inserting "abcdefgh" in the form results in "efgh"...
Any Ideas?

Copying that example to my debian system, running PHP 4.2.3 on an apache 1.3.26, the result is fine and works as expected.

Hope that helps finding another bug,
Stefan
 [2002-11-29 14:20 UTC] jazar at zacks dot com
The answer will be "We are not support previous PHP versions" ;-)
 [2002-12-15 06:44 UTC] roberto_orenstein at yahoo dot com dot br
Running php 4.2.3 on apache 1.3.27 on Win2k.
In some pages my POST  variables make it to the next page missing the first 4 character's. If I send "test_data", I'll get only "_data" on the other side. The funny thing is that it only happens in one machine. I have two other machines with the same configuration and nothing wrong happens. And it appears that this bug happens only with array from form variables.
Any thoughts???
 [2003-01-11 02:49 UTC] tagg_maiwald at yahoo dot com
I did encounter a similar coding error: queried the $_POST array multiple times, came up empty subsequent times.

CODE FIX: reset($_POST)

HTTP SERVER/PHP TEST SCRIPT:
<html>
<body>
<h1>posttest.php</h1>
<form name="bar" method="post" action="posttest.php">
<p>
<input name="foo_a" type="checkbox"> Foo A<br>
<input name="foo_b" type="checkbox"> Foo B<br>
<input name="foo_c" type="checkbox"> Foo C<br>
<input name="foo_d" type="checkbox"> Foo D<br>
<input name="bar[]" type="text" value="bar i"> Bar 1 <br>
<input name="bar[]" type="text" value="bar ii"> Bar 2 <br>
<input name="bar[]" type="text" value="bar iii"> Bar 3 <br>
<input name="bar[]" type="text" value="bar iv"> Bar 4 <br>
<input type="submit" value=" Submit Foos ">
</p>
</form>
<form name="bar" method="post" action="posttest.php">
<p>
<?php

function get_foos()
{	$i_counter=0;
	if (isset($_POST)&&(0<count($_POST)))
	{	$sz_ret = "<br> method = post";
		while (list ($cgi_foo, $cgi_on) = each ($_POST))
		{	if (is_array($cgi_on))
			{	while (list ($cgi_bar, $cgi_val) = each ($cgi_on))
				{	$sz_ret .= "\n".'<br>'.$cgi_foo.'--'.$cgi_bar.'<input type="text" name="'.$cgi_foo.'['.$cgi_bar.']" value="'.$cgi_val.'">';
				}
			} elseif (('on'==$cgi_on)&&('foo_'==substr($cgi_foo,0,4)))
			{	$sz_ret .= "\n".'<br>'.$cgi_foo.'<input type="text" name="'.$cgi_foo.'" value="'.$cgi_on.'">';
			} else
			{	$sz_ret .= "\n<br>got: '$cgi_foo', '$cgi_on'";
			}
			$i_counter++;
		}
		if (1>$i_counter)
		{	echo "\n<pre>\n";
			print_r ($_POST);
			echo "\n</pre>\n";
		}
	}	elseif (isset($_GET)&&(0<count($_GET)))
	{	$sz_ret = "<br> method = get";
		while (list ($cgi_foo, $cgi_on) = each ($_GET))
		{	if (is_array($cgi_on))
			{	while (list ($cgi_bar, $cgi_val) = each ($cgi_on))
				{	$sz_ret .= "\n".'<br>'.$cgi_foo.'--'.$cgi_bar.'<input type="text" name="'.$cgi_foo.'['.$cgi_bar.']" value="'.$cgi_val.'">';
				}
			} elseif (('on'==$cgi_on)&&('foo_'==substr($cgi_foo,0,4)))
			{	$sz_ret .= "\n".'<br>'.$cgi_foo.'<input type="text" name="'.$cgi_foo.'" value="'.$cgi_on.'">';
			} else
			{	$sz_ret .= "\n<br>got: '$cgi_foo', '$cgi_on'";
			}
			$i_counter++;
		}
		if (1>$i_counter)
		{	echo "\n<pre>\n";
			print_r ($_POST);
			echo "\n</pre>\n";
		}
	} else
	{	$sz_ret .= "<br> no data extracted";
	}
	$sz_ret .= "<br>i_counter = $i_counter";
	return $sz_ret;
}

	print get_foos();
?>
<br><input type="submit" value=" Submit Bazs ">
</p>
</form>
</body></html>
 [2003-01-11 02:54 UTC] tagg_maiwald at yahoo dot com
Ack.
1. First form name = foo
2. Second (last) print_r: print_r ($_GET)
 [2004-03-08 06:54 UTC] dbucher at horus dot ch
I have exactely the same problem.

For some people they have the problem 9 out of 10 times,
they can't use the script at all.

Personnally, some days I have the problem 1/4 times, some
other days almost never.

I'm using $_POST['xxx']
And PHP Version 4.1.2
Under Linux (none) 2.4.20-6um #1 SMP Fri Jun 6 10:15:19 EDT 2003 i686 unknown
safe_mode
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC