Here is my php code and I want to somehow change the message the users sees when they submit the form to include there name like “Ben, Your message has been sent!” I also want to keep it styled like it is now but then include the name.
<?php
if(isset($_POST['submit'])){
$to = "benlevygraphics@gmail.com";
$headers = "From: " . $_POST['email'];
$subject = "Ben, you have been contacted...";
$body = "Name: " . $_POST['name'] . "\nEmail: " . $_POST['email'] . "\nWebsite: " . $_POST['web'] . "\nMessage: " . $_POST['message'];
if(mail($to, $subject, $body, $headers)){
echo("<p class=contactformsent>Your message has been sent!</p>");
}
else{
echo("<p class=contactformnotsent>Message delivery failed...</p>");
}
}
?>
So insert the name into the message: