#19052 [Com]: $_POST doesn't work correctly
| From: | lar3ry at emuck dot com | Date: | Wed, 11 Dec 2002 18:02:32 +0000 |
| Subject: | #19052 [Com]: $_POST doesn't work correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27391@lists.php.net to get a copy of this message | ||
ID: 19052
Comment by: lar3ry@emuck.com
Reported By: awilliam@mdah.state.ms.us
Status: Bogus
Bug Type: Apache2 related
Operating System: Red Hat 7.3 Linux 2.4.18
PHP Version: 4CVS-2002-08-22
New Comment:
I think I found the failure mode. The submit button in the example
doesn't have a name attribute. If you add a name attribute to the
"Insert Record" field, the bug disappears and the $_POST array appears
correct. (I tried this using A/B comparisons between a page that
worked and the example above until the example worked).
Could the work-around be to ensure that all form elements have name
attributes?
Fixing this might be pretty important. I'm probably not the only
person stuck running RedHat 8.0, which uses Apache 2.0.40 and php
4.2.2, and the version of RH 8.1 beta that I've checked seems to have
the same bug. [sigh]
Anyway, here's the "corrected" version of the script which seems to
work on my configuration:
<!-- insert_form.html-->
<HTML>
<HEAD><TITLE>Insert Form</TITLE>
</HEAD>
<BODY>
<FORM ACTION="<?php echo $_SERVER['PHP_SELF']; ?>"
METHOD="POST">
<P>Text to add:<br>
<input type=text name=testField size=30>
<p><input name=sfield type=submit value="Insert Record"></p>
</FORM>
</BODY>
</HTML>
<!-- end insert_form.html-->
<!-- insert.php -->
<?php
echo "the value is $_POST[testField]<BR>";
?>
<!-- end of insert.php -->
Previous Comments:
------------------------------------------------------------------------
[2002-09-27 13:06:13] awilliam@mdah.state.ms.us
I just compiled apache 2.0.42 and php 200209270600 from snaps.php.net
and still have the same error. I tried it with Mozilla 1.1 and IE 5.5.
------------------------------------------------------------------------
[2002-09-26 12:15:14] sniper@php.net
Most likely problem within the browser.
Also, try more recent versions of PHP and Apache2 if that
is not the case.
------------------------------------------------------------------------
[2002-08-22 14:47:32] sander@php.net
Dupe of #19047.
------------------------------------------------------------------------
[2002-08-22 12:18:18] rasmus@php.net
Ah, ok, it is an Apache2-related issue then. This stuff is still very
experimental. Use Apache 1.3 if you just want your stuff to work.
Otherwise dive into the code and let us know what the fix is.
------------------------------------------------------------------------
[2002-08-22 12:14:17] awilliam@mdah.state.ms.us
I am using Apache 2.0.40. It was compiled using ./configure
--enable-modules=all
I compiled PHP using ./configure --enable-track-vars --with-mysql
--with-mail
--with-apxs2=/usr/local/apache2/bin/apxs
If you need the output of phpinfo(); it is
http://www.squeezer.net/phpinfo.php
------------------------------------------------------------------------
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/19052
--
Edit this bug report at http://bugs.php.net/?id=19052&edit=1