#32601 [Fbk->Opn]: Related to Bug #18648 Single entry form POST gives incorrect variable content.
| From: | sarah dot lee at seh dot ox dot ac dot uk | Date: | Wed, 06 Apr 2005 12:23:09 +0000 |
| Subject: | #32601 [Fbk->Opn]: Related to Bug #18648 Single entry form POST gives incorrect variable content. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76438@lists.php.net to get a copy of this message | ||
ID: 32601
User updated by: sarah dot lee at seh dot ox dot ac dot uk
Reported By: sarah dot lee at seh dot ox dot ac dot uk
-Status: Feedback
+Status: Open
Bug Type: Apache related
Operating System: Windows XP
PHP Version: 4.3.9
New Comment:
The result is:
array(1) { ["ptitle"]=> string(4) "text" }
I found a work-around last night, using "if ($_POST) { .. }" rather
than "if ($submit) { .. }", but it still doesn't explain why $submit is
not recognised.
Previous Comments:
------------------------------------------------------------------------
[2005-04-06 13:51:12] sniper@php.net
What does this output when you press simply enter:
test.php:
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'];
?>">
<input type="text" size="30" maxsize="50" name="ptitle"
value="">
<input type="submit" name="submit" value="Submit">
</form>
<?php var_dump($_POST); ?>
------------------------------------------------------------------------
[2005-04-06 01:58:06] sarah dot lee at seh dot ox dot ac dot uk
Description:
------------
This is related to Bug #18648 Single entry form POST gives incorrect
variable content.
My problems seem to be similar to that of other users on that thread, a
form with a single text box doesn't really submit if the enter button is
pressed.
I'm using Apache 1.3 on Windows. In my httpd.conf, I don't have any
InputFilters/OutputFilters, just
AddType application/x-httpd-php .php
I've tried the other fixes suggested: <form ...
enctype="multipart/form-data"> doesn't fix it, and nor does <input
type=hidden name=spoof>.
I seem to be the only one mentioning it with Apache 1.3. Is there
anything that can be done to solve it?
Reproduce code:
---------------
In an include:
<form method="POST" action="<? echo $PHP_SELF ?>?pid=<? echo $pid
?>">
<input type="text" size="30" maxsize="50"
name="ptitle"
value="">
<input type="submit" name="submit" value="Submit">
</form>
In the PHP script:
if ($submit) {
...
}
Expected result:
----------------
I expect the data to be carried to the PHP script, as it would if the
submit button were actually clicked.
Actual result:
--------------
The page just gets refreshed with the data before any text was entered
into the text box, and enter pressed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32601&edit=1