bharat_r
In the zone
I want to design a webpage which would get data from a form and send the collected data to my mail id.
I used the following html codes to get the data:
And used the following php script
But I'm not getting what I enter in the form to my mail.
How do I do it. Please Help.
I used the following html codes to get the data:
Code:
<html>
<head><Title></Title></head>
<form method="post" action="contact.php">
Email: <input name="email" type="text"><br>
Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input name="send" type="submit">
</form>
</html>
And used the following php script
Code:
<?php
$to = "bharatkrishna.r@gmail.com";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
But I'm not getting what I enter in the form to my mail.
How do I do it. Please Help.