What should an application do, if a $_POST
variable is missing, which is required to perform the action?
For example, imagine I have a form with an <input name="title">
and I have some page, which processes the resulting POST request. Now, what should this page do, if it gets a request, but no $_POST['title']
variable was set?
To make it clear: By "not set" I mean, that an invalid request is made, which a normal user cannot do, only somebody making a manual request to my form processing page, i.e. somebody trying to do things with my site, I don't want it to be done with.
Some possibilities:
- Just
die
. - Print a fancy error message, like you would do, it the field were just empty.
- Block further requests from this IP.