@SyCoJun 17.2008 — #it's not an IE thing at this point THis is preocessed before it goes to the browser. PHP is serverside. Might be how you're setting the value of submit in the form, without seeing more theres no way of knowing.
If you have access to the ini file turn up error handling to E_ALL and you'll probably get an undefined error for the missing value. You can do it per script (or in an included header too)
E_ALL make development much easier once you get used to the extra error messages and if you move your code to a server with E_ALL set you'll be fine. Most peoples code would blow up when moved from a non E_ALL environment.
@SyCoJun 17.2008 — #(Edit: isset() prevents the error, If you echo the var direct you'll get an error which can be supressed with an @. isset is the correct thing to use, just adding to the thread for info...)
I just tried print_r($_POST) with the input type image
[code=php]<? print_r($_POST) ?> <form method="post"> <input type="image" name="submit" src="http://www.webdeveloper.com/forum/images/webdev-logo2.gif" value="Send" alt="Send" title="Send" /> </form>[/code] a click gives this [code=php]Array ( [submit_x] => 54 [submit_y] => 12 ) [/code] and another click gives [code=php]Array ( [submit_x] => 21 [submit_y] => 9 ) [/code] It looks like you have the x and y co-ordinates of the mouse click position and the _X or _y so your test for submit is going to fail.
@Nicholas222authorJun 17.2008 — #but the php-code is actually on another page so the form must be submitted. Otherwise you can't go to the "action"-page, right?
I don't see why there is a difference between IE and other browsers if PHP is processed on the apache server.
@SyCoJun 17.2008 — #Yea this is just an example. I didn't set an action so it goes to itself by default. Set the action in yours and add a hidden input and test for that on the receiving page.
@chazzyJun 18.2008 — #actually it definitely should be, and provides you a lot of flexibility doing it this way. Let's say you have an image that's something like
@Nicholas222authorJun 18.2008 — #First of all, i would be using 2 imgs, en btw the mouse coordinates are always send, which I don't have a problem with. FF, Safari, ... they all send'em.
The problem is that IE doesn't send the name-attribute and better browsers do.
MrCoder, true but in my opinion, an extra hidden field isn't necessarily needed, as I can also check if the message (for example) was set?
@MrCoderJun 18.2008 — #MrCoder, true but in my opinion, an extra hidden field isn't necessarily needed, as I can also check if the message (for example) was set?[/QUOTE]
I just like my method since you can handle multiply actions from one switch/case (Or if/else if that's your thing) using the hidden value.