I have created the simple contact form and doing some tweak. My question whenever the visitor sent the message, the line should be display “Thank you $name your form has been submitted”. How can i write this on echo, I am doing this, but it was not taken. Here is my PHP code
[code]<?php
if (isset($_POST[‘contact_name’]) && isset($_POST[‘contact_email’]) && isset($_POST[‘contact_time’]) && isset($_POST[‘contact_text’])) {
$contact_name = $_POST[‘contact_name’];
$contact_email = $_POST[‘contact_email’];
$contact_time = $_POST[‘contact_time’];
$contact_text = $_POST[‘contact_text’];
if (!empty($contact_name) && !empty($contact_email) && !empty($contact_time) && !empty($contact_text)) {
$to = '[email protected]';
$subject = 'Custom Contact Form';
$body = $contact_name."\n".$contact_time."\n".$contact_text;
$headers ='From: '.$contact_email;
if (mail($to, $subject, $body, $headers)) {
echo 'Your form has been submitted. We\'ll contact you shortly.';
} else {
echo 'There was an error';
}
}else {
echo 'All fields are required.';
}
}
?>[/code]