Hello everyone,
New to PHP and just starting to learn things.
I have set up an e-mail, very basic, below is the code.
Everything appears to be working but I'm still learning.
I need the echo confirmation message that appears after the e-mail is submitted to contained the mail senders name.
Like this: Thanks Mariah for taking the time to participate in the evaluation, we will contact you within 24 hours.
Instead of this: Thanks for taking the time to participate in the evaluation, we will contact you within 24 hours.
Also, can anyone please tell me how I can style the echo message using html tags? Like how do I use the <p> or <h1> tag to format the echo confirmation message?
I'm am an advance CSS/Xhtml user but I don't know how to applied these tags within PHP echo.
Any ideas?
Thanks everyone. - IC
<?php
//FORM INPUT COLLECTION
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$soupPreference = $_POST['soupPreference'];
$howMany = $_POST['howMany'];
$changes = $_POST['changes'];
$messageComments = $_POST['messageComments'];
//FORM PROCESSOR
$to = 'mymail.com';
$subject = 'Canned soup evaluation report';
$msg = "First Name: $firstName\n\n" .
"Last Name: $lastName\n\n" .
"E-Mail: $email\n\n" .
"Do you like canned soup? $soupPreference\n\n" .
"How many canned soup do you eat in a day? $howMany\n\n" .
"What changes or suggestions would you recommend: $changes\n\n" .
"Comments: $messageComments";
mail($to, $subject, $msg, 'from:' . $email);
echo 'Thanks for taking the time to participate in the evaluation, we will contact you within 24 hours.';
?>