So, why not redirect to a thank you message?Alternatively, use JS to display a "Message successfully submitted" kind of message on the redirect page, then have it vanish after a few seconds.I could help you with that if that seems like a good option.

I would also have thought that your hosting company would have an option for such an eventuality.Who are they? Do you have links to any kind of documentation?

Thanks for the tip, Pullo. I created a separate page and it gets redirected to that page with the message. The only thing is that a blue "redirect" link in the top left corner of the browser flashes for 1 second and then disappears after I hit submit button. Is it supposed to work that way with redirect feature or it just depends on the speed of my internet connection?

I just spoke with my host support and they said that 'redirect' link flashes too fast and they are not able to actually catch what it says...:), however, they said it's part of their 'redirect' feature that I use so it can't be fixed on their end as this is the way it works for now.

You'll see, that this is nothing more than a simple form, which gets submitted to a file called "submit.php"

submit.php will then check the data it received. If validation fails, it'll show an error message, otherwise it'll show a success message.In our example, I'll make all of the fields mandatory and I'll validate the email address against a regular expression:

"Your message has been sent" appears in a blank browser window after I hit submit. I wanted it appear within text area of the form - same way when I use my host 'redirect' feature.

Building a contact form, although not overly complicated, does involve a number of steps and moving parts (so to speak). It is my intention to get the form working first of all, then customize it in a second step. Don't worry

810311 said:

After I hit 'submit' it takes a long time to process.

I am not receiving a test message that I sent to my host webmail.

This sounds like your provider has blocked PHP's mail function.The reason might be that the mail function is sometimes seen as a security risk, as a badly coded contact form can be used as a spam relay.

The code you posted looks fine.

Would it be possible for you to contact your hosting company and ask if they allow you to build your own contact forms and more specifically if PHP's mail function is specifically blocked on their servers?