I have not got any php knowledge and I have found a php code on the net and using it to send e-mail from a web html form.So far the form and the code works fine.
I have the following php code for a contact form and i would like to add a simple Html thank you page when user submits the form.
Here is the code;
Expand|Select|Wrap|Line Numbers
- <?php
- if(isset($_POST['submit'])) {
- $to = "email@e-mail.com";
- $subject = "Test Message";
- $name_field = $_POST['fullname'];
- $email_field = $_POST['email'];
- $phone_field = $_POST['phone'];
- $message = $_POST['message'];
- $body ="From:$name_field\nEMail:$email_field\nPhone:$phone_field\nMessage:$message\n";
- echo "Your message has been successfully sent $to!";
- mail($to, $subject, $body);
- } else {
- echo "There was an error sending this message. Please contact us from e-mail@e-mail.com";
- }
- ?>
Can you please help and modify the code please with some suggestions?
Thank you in advance
ECOT