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: Bogus Bug Type: Apache related Operating System: Windows XP PHP Version: 4.3.9 New Comment:
Sorry to confuse, but I've just discovered someting new. When simply pressing enter: array(2) { ["ptitle"]=> string(0) "" ["submit"]=> string(6) "Submit" } When pressing enter and the cursor is in the box (as is the norm when you have just finished typing something): array(1) { ["ptitle"]=> string(0) "" } Previous Comments: ------------------------------------------------------------------------ [2005-04-06 18:19:16] [EMAIL PROTECTED] There we go. You're getting just correct input. No bug here. (ALWAYS use the superglobals $_GET, $_POST, etc) ------------------------------------------------------------------------ [2005-04-06 14:26:54] sarah dot lee at seh dot ox dot ac dot uk Sorry, my mistake - I misread your question. Output is: array(2) { ["ptitle"]=> string(0) "" ["submit"]=> string(6) "Submit" } ------------------------------------------------------------------------ [2005-04-06 14:23:08] sarah dot lee at seh dot ox dot ac dot uk 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. ------------------------------------------------------------------------ [2005-04-06 13:51:12] [EMAIL PROTECTED] 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