Hi,

I am trying to come up with a form with more then one submit button, and
am seeing some unexplainable results. Here is a small complete page to
illustrate it:

============ cut here ===============================
<html><head></head><body>
<?
if (  $HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST"  ) {
       echo "action is " . $_POST["action"] . "<br>\n";
} else {
?>
<form action="test.php" method="post">
<table>
<tr><td>
<BUTTON type="submit" name="action" value="Save">Save</button>
</td><td>
<BUTTON type="submit" name="action" value="Find">Find</button>
</td></tr>
</table></form>
<?}?>
</body></html>
=======================cut here======================
so, here are two buttons, one called Save and another one called Find.
The idea is that $_POST["action"] will be set to the value of the button
pressed. I tried it with php 4.3.0 and 4.3.2.

The thing is that Mozilla 1.0.1 on Linux does behave this way:
"action is Save" shows after hitting the 'Save' button, "action is Find"
showa if the 'Find' button is pressed.

IE of different versions though show only "action is Find", no matter
what button I press!

How is this at all possible - does the server's PHP code behave
differently depensding on the client's browser type - I find it so hard
to believe...

Any ideas/suggestions on how to have browser invariant multiple submit
buttons would be highly appreciated.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to