- Impact
- 19
PHP:
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">
Your Name: <input type="text" name="name" size="20"><br>
Your Email: <input type="text" name="email" size="20"><br><br>
Friends Email: <input type="text" name="id" size="20"><br>
<input type="submit" value="Submit">
</form>
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$header=$_POST['subject'];
$comments= "Hi" . $POST['name']
"I was surfing the net when i came across [url]http://www.funnymedia.net[/url], And Its AWESOME, I THINK YOU MUST CHECK IT!.";
$to=$_POST['id'];
$message=$comments;
if(mail($to,$header,$message,"From: $email\n")) {
echo "Thanks for Telling your friend about our website, THe email has been succesfully SEND.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
Can anyone tell me whats wrong wid tht code? Its not working




