Rectangle 27 0

PHP - Only Show Errors in Development Stage

Only Show Errors in Development Stage (Mostrar erros somente no estgio de desenvolvimento)

Rectangle 27 0

You can indeed redirect using the php header as stated by SimonEritsch. However, take care to NOT redirect if there is a problem with the form as you will most likely need to show/re-render the form again to allow the user to correct the error. only redirect away on success.

You could also use the header("Location:myResponsePage.php") which is immediate, rather than incorporating a delay.

There are a variety of methods you can employ in an attempt to limit spam/bots from processing the form. These range from captures such as that from Google (again as mentioned below by SimonEritsch) to implementing your own additional checks either side of your form. For example:

  • Check the referrer is actually the submission page on your own site and that the data does not come from elsewhere.
  • Perhaps create a session variable at some other stage in the process that must be visited before submitting the form. You can then also pass that as a hidden form variable. If the passed value is incorrect or the session value does not exist then all processes probably haven't been followed.
  • There is a simple "blank field" trick but I personally wouldn't recommend JUST doing that. Interesting though.

forms - PHP redirection after post and thank you message - Stack Overf...

php forms redirect post