Bug 76559 - Single entry form POST gives incorrect variable content
Summary: Single entry form POST gives incorrect variable content
Keywords:
Status: CLOSED DUPLICATE of bug 82967
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: php
Version: 8.0
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL: http://bugs.php.net/bug.php?id=18648
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-23 13:40 UTC by Need Real Name
Modified: 2007-04-18 16:47 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-21 18:50:01 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2002-10-23 13:40:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Description of problem:
A single-field form results in an incorrect variable being passed.  For example:

<?php

echo "
  <form action=\"foo.php\" method=\"post\">
  <input type=\"text\" name=\"bar\">
  <input type=\"submit\" value=\"Hit me!\">
  </form>";

?>

returns the variable $bar with contents: <value>bar=<value>

See the thread here: http://bugs.php.net/bug.php?id=18648

thanks.

josh.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
See description.

Actual Results:  See description.

Expected Results:  See description.

Additional info:

You can workaround this by adding a hidden field:

<input type=hidden name=foo>

but it's ugly.

Comment 1 Joe Orton 2002-12-02 11:25:24 UTC
I can't reproduce a problem here with single-field forms.  When you say
"variable $bar" you are aware that register globals is off in the default
configuration (/etc/php.ini), so you have to retrieve form variable using
"$_POST['bar']"?

Comment 2 Need Real Name 2002-12-02 11:37:45 UTC
I have register globals set to On.

Have you checked the bug report in the PHP bugzilla:

http://bugs.php.net/bug.php?id=18648

...so I'm not the only one with RH8.0 experiencing this problem.

Let me clarify the description of the bug: if I create a single field form, the
variable value gets mangled to the following format: <value>foo=<value>.  Say I
enter "bar" in a text field, I get "barfoo=foo" returned.

Many thanks, josh.


Comment 3 Need Real Name 2002-12-02 11:39:27 UTC
Sorry, a mistake.  In my example I gave in the previous posting, the returned
variable should read "barfoo=bar".

josh.

Comment 4 Joe Orton 2002-12-02 11:48:52 UTC
Yes, I've read the upstream bug reports too, but I can't reproduce the problem
here on a vanilla 8.0 system.  Maybe it's a random corruption problem.

Comment 5 Need Real Name 2002-12-02 12:04:38 UTC
See:

http://napalm.cse.bris.ac.uk/test.php

http://napalm.cse.bris.ac.uk/test.txt

thanks, josh.



Comment 6 Joe Orton 2002-12-02 12:36:55 UTC
Ah, that's interesting - thanks for posting that. A diff between the script
output on your system and mine reveals:

-//--></style><title>phpinfo()</title></head><body>fishfoo=fish
+//--></style><title>phpinfo()</title></head><body>fish

...that it works on mine but not yours...

and that our servers are using different locales:

-<tr valign="baseline" bgcolor="#cccccc"><td
bgcolor="#ccccff"><b>_ENV["LANG"]</b></td><td>C?</td></tr>
+<tr valign="baseline" bgcolor="#cccccc"><td
bgcolor="#ccccff"><b>_ENV["LANG"]</b></td><td>en_US.UTF-8?</td></tr>


Comment 7 Joe Orton 2002-12-02 12:46:03 UTC
I'm still unable to trigger the problem even in the C locale.

Comment 8 Need Real Name 2002-12-02 12:53:36 UTC
I changed the system locale as a workaround to another (unrelated) problem.  See:

http://www.ee.ethz.ch/~slist/mrtg/msg21135.html

josh.

Comment 9 Joe Orton 2003-07-08 15:39:07 UTC
The PHP package works correctly in this configuration in the latest erratum. 
Thanks for the report.

*** This bug has been marked as a duplicate of 82967 ***

Comment 10 Red Hat Bugzilla 2006-02-21 18:50:01 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


Note You need to log in before you can comment on or make changes to this bug.