Forum Moderators: coopster

Message Too Old, No Replies

<input type="image"> problem

Multiple Submits

         

xtrace

10:24 pm on Jun 27, 2006 (gmt 0)



Been banging my head against a wall for a coupla days on this!
I'm trying to submit different Vars values, I been reading a lot, but I can't make it work in IE7 (It works fine on Firefox)
Any Help?
Here is an example :
============================================
if (isset($_POST["ordervar_x"])) {

} else if (isset($_POST["ordervar_y"])) {

} else {
$ordervar = "row1";
}
<td>
<input type=image name="ordervar" value="row2" src="imgs/here.gif" hspace="3" width="5" align="absmiddle">
</td>
<td>
<input type=image name="ordervar" value="row3" src="imgs/here.gif" hspace="3" width="5" align="absmiddle">
</td>

$sql = "SELECT * FROM BLABLA ORDER BY $ordervar";
=============================================

Thanks

eeek

10:48 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you tried printing out $_POST?

eelixduppy

10:53 pm on Jun 27, 2006 (gmt 0)



Welcome to WebmasterWorld xtrace!

Firstly, your inputs have the same name. If you want to keep this, but just have them submitted in an array, you must add '[]' to the end of the name (name="ordervar[]"), otherwise you should make the names unique. Secondly, I don't see where $_POST["ordervar_x"] and $_POST["ordervar_y"] are coming from.