I have a form. When the form data are submitted, I’d like to send the user a JavaScript alert saying, ‘thanks for submitting the form’.
I’m looking for some kind of conditional to use to make this possible. I tried testing the $_POST array with isset and even though the print_r was showing an empty array, the alert came up. Seemed unreliable.
Any ideas are much appreciated.
the REQUEST_METHOD is the only 100% reliable method of testing if a particular type of HTTP request is active. Checking form fields is unreliable – field names can get typoed, missed, deleted, hacked, etc…