1. Welcomecaller.php
<form name="myForm"
action="/send.php" method="post">
<input type="hidden" name="subject" value="Form Submission" />
<input type="hidden" name="redirect" value="thankyou.html" />
Name: <input type="text" name="fname" />
Email: <input type="text" name="email" />
Phone No: <input type="text" name="phone" />
<input type="submit" name="submit" value="submit"/>
</form>
2. Send.php
<?php
$to = "safiullah12@hotmail.com";
$subject = "Brought to you ";
$Sender = "info@bengalilist.com";
$message = $_POST["fname"] . "\r\n".
$_POST["email"] . "\r\n".
$_POST["phone"] . "\r\n" ;
// Echo "Name: $FirstNam . \tEmail Address: $Email " ;
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers = "From: ".$Sender . "\r\n" .
'Reply-To: '.$Sender. "\r\n".
'X-Mailer: PHP/' . phpversion();
if (mail($to,$subject,$message, $header)){
echo("<p>Message successfully sent!</p>");
echo ( '<A href = "index.php">Home Page</A>' );
} else {
echo("<p>Message delivery failed...</p>");
}
?>
3. User enter in number 1(welcomecaller.php) as below: john for Name. abc@hotmail.com for email. 6092141834 for phone.
4. I get email no problem. I get email as below:
john
abc@hotmail.com
6092141834
5. Instead, I am expecting an output as below. How can I get an output as below?
Name = john
Email = abc@hotmail.com
Phone = 6092141834
Someone pls correct my code and help me getting an output as no-5.
Thanks a lot.