Originally posted by Darker@21 September 2003 - 15:11
Open a new text document, paste this code into it and save as contact.php - modify the contact form to whatever it should look, change the $sendto to your email address and upload the contact.php
Done
P.S: Dirty coded in 2 mins but should work fine :P
<?php
$sendto="
[email protected]";
$subject="Cool - An email for me";
$font_face_email="Arial";
$font_size_email="2";
if(!empty($_POST["message"]))
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "FROM: ".$_POST["email"]." \r\n";
$pre.="<font face=\"$font_face_email\" size=\"$font_size_email\" color=\"$font_color_email\">\n";
$pre.="===========SENDER'S DETAILS===========<br>\n";
if($_POST["name"]!="")
{
$pre.="Email from ".$_POST["name"].",<br>\n";
}
else
{
$pre.="Email from ".$_POST["email"].",<br>\n";
}
$body=ereg_replace("[\n]","<br>",$_POST["message"]);
$body=ereg_replace("[\\]","",$message);
mail($sendto, $subject, $pre."<br>\n\n".$body."\n", $headers);
?>
<font face="Arial" size="2"><BR>Thank you<BR>
Thank you for sending me an email
<?php
} else {
?>
<html>
<head>
<title>Dirty Contact Form by Darker</title>
</head>
<body>
<form method="POST" action="contact.php">
<p>Name: <input type="text" name="name" size="20"></p>
<p>Email: <input type="text" name="email" size="20"></p>
<p>Message</p>
<p><textarea rows="2" name="message" cols="20"></textarea></p>
<p><input type="submit" value="Submit" name="Submit"></p>
</form>
</body>
</html>
<?php
}
?>
Short and sweet! B)