Techno Hippy wrote:Correct, I wrote that before I read the thread properly, thought there'd be no harm mentioning it just in case anyway.BCrowe wrote:Surely that wouldn't stop the form from posting? It would just be a problem when you tried to handle the form data?
There's nothing wrong with that code snippet, I just tested it in Opera and it works fine. value="Submit" or value="Reply" makes no difference.
Using an input type of image instead of submit changes the variables that get posted to PHP when the button is clicked. For a normal input type with name="DoSomething" and value="Go", you'd get $DoSomething in PHP with a value of "Go" (or just $_POST if register_globals is turned off). An image submit of the same type gives you $DoSomething_x and $DoSomething_y in PHP, with the x and y coordinates of where on the image was clicked. If your button does not have name attribute, as above, then you'll just get $x and $y. If you're checking for a certain value after the button is clicked, make sure you take that into account.
#6298816, By BCrowe PHP anomaly
BCrowe 507 posts
Seen 14 hours ago
Registered 7 years ago