Sometimes the posted data does not have the value content of submit
button.
For example if the focus is in Inputbox and you press "enter" key. In
this case the first submit button will have focus.
So whatever you write in name, you need check the second submit button
in your if condition.
eg:
if(!empty($_POST))
{
// Form Posted
if(isset($_POST['second_button_name']))
/*
You can code this way if name is same for both button
if(isset($_POST['button_name'])
&& $_POST['button_name'] == "second_button_value")
*/
{
// Second button clicked
}
else
{
// First button clicked
}
}
--
Cheers,
Rahul Anand
"Ryan" <rc******@nospammerz.ucdavis.edu> wrote in message news:<pa****************************@nospammerz.uc davis.edu>...
I currently have two image submit buttons. The code generated looks like
so:
<input type="image" src="button_in_cart.gif" border="0" alt="Add"
title="Add" name="btn_cart" value="buy">
<input type="image" src="modify.gif" border="0" alt="modify"
title="modify" name="btn_modify" value="modify">
In mozilla everything works great, but in Konqueror and MSIE the if
statement I'm using to detect which button was press does not work.
if (isset($HTTP_POST_VARS['btn_cart'])){ do stuff }
Does anyone know how to fix this without resorting to javascript?
thanx
-ryan