Previous link wasn't really what you're loooking for.
Copy/paste the below codes, and let me know !
PHP:
Code:
<?php
if ($_POST["action"] == "send"){
if ($_POST[name] != "your name" and $_POST[name] != "" and $_POST[email] != "your e-mail adress" and $_POST[email] != "" and $_POST[message] != "") {
mail ("me@mysite.com", "via website (EN)",
"
Name: ".$_POST['name']."
E-mail: ".$_POST['email']."
Message: ".$_POST['message']."
",
"From: ".$_POST['name']." <".$_POST['email'].">");
$subject = "your message to (your name)";
$msg = "
Dear $_POST[name],
Thanks for your message to (your name).
She will get back to you as soon as possible.
This was your message:
$_POST[message]
";
$headers = "your name";
mail($_POST[email], $subject, $msg, $headers);
echo '<p align="center"><font color="#003366">Your message has been sent, <br>and you will receive a confirmation mail. <br> We will get back to you as soon as we can.</font></p>';
}
else{
echo '<p align="center"><font color="#FF0000">Please fill in all data!<br>All fields are obligatory.</font></p><p><a href="contactENform.html">[back]</a>';
}
}
?>
HTML:
Code:
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td align="center" valign="middle" style="padding-left:210px;">
<script language="JavaScript" type="text/JavaScript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
</script>
<FORM NAME="form1" METHOD="post" ACTION="contactEN.php">
<input type="hidden" name="action" value="send">
<table width="100%" valign="top" align=center>
<tr><td>
<table width="160" align=left>
<tr><td width="154" height="26" align=center background="icon/form.jpg">
<INPUT TYPE=TEXT NAME="name" VALUE="your name" onFocus="clearDefault(this)" style="border:0px; width:148px">
</td></tr>
<tr><td width="154" height="26" align=center background="icon/form.jpg">
<INPUT TYPE=TEXT NAME="email" VALUE="your e-mail adress" onFocus="clearDefault(this)" style="border:0px; width:148px">
</td></tr></table>
</td><td align=left valign=middle>
<INPUT TYPE="image" src="icon/emailgo.jpg" NAME="submit" VALUE="go" style="border: 0px">
</td><td style="padding-left:20px;">
</td></tr></table>
<table width="100%" valign="top" align=center>
<tr><td width="250" height="120" align=center valign="middle" background="formbericht.jpg" class="focusareaback">
 <TEXTAREA NAME="message" style="border:0px; width:240px; height:110px"></TEXTAREA>
</td></tr></table>
</FORM>
</td></tr></table>
Note that in this script, text is already placed into the <input> fields.
Bookmarks