Last Updated: February 25, 2016
·
506
· banago

Beware of checking if a form is submitted using an image input type

Fact: Firefox and IE, not sure which versions, won't register input type of image in the $_POST superglobal. That means this code will fail:

if( isset( $_POST['submit'] ) { ... }

in the case when:

<input type="image" name="submit" src="/some/image/path.png">

That's it. There are a lot of ways to get past this so it makes no sense to explain here. Just wanted to make sure folks that are developing on Chrome, might be not able to notice this very easily.