foaly
Senior Member
Posts: 718 Reputation: 20
38 / /
Joined: Jul 2006
|
RE: (php) Contact Us form
quote: Originally posted by Nathan
Make this into one file:
code: <?php
if (isset($_POST['submit'])) {
/*Here we are going to declare the variables*/
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//Save visitor name and entered message into one variable:
$formcontent="VISITOR NAME: $name\n\nFEEDBACK: $message";
$recipient = "msgcrap@live.com";
$subject = "Contact Us - Messenger Crap";
$mailheader = "From: $email\r\n";
$mailheader .= "Reply-To: $email\r\n";
$mailheader .= "MIME-Version: 1.0\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
echo "Thank You!";
i would let it die here...that looks better...
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Messenger Crap - Contact Us</title>
</head>
<body>
<form action=" " method="POST">
Name: <br />
<input type="text" name="name" size="35" />
<p>
</p>
<p>
</p>
Emailbr />
<input type="text" name="email" size="35" />
<p>
</p>
<p>
</p>
Message:
<br />
<textarea name="message" rows="4" cols="40"></textarea>
<br />
<p>
<input type="submit" value="Send" style='width:100px;' />
<input type="reset" value="Clear" style='width:100px;' />
<input type="submit" name="submit" value="Login" />
<input type="hidden" name="submit" value="TRUE" />
</form>
</body>
</html>
I have not tested this but it should work.
|
|