11-03-2009, 01:46 PM
Code:
<?php
if (isset($_POST['email'])) {
mail("nbokmans@gmail.com", $_POST['email']);
print_sent();
} else {
getdata();
}
<BR></TD></TR></TABLE>
<div align="left"><font face="Comic Sans MS"><font size="2"><strong>After entering those fields, we will try to make contact with you as soon as possible. Your input is saved in our computer, and it won't be distributed to 3rd parties.<br /></strong></font></font></div>
<br />
<form onsubmit="return checkForm();" action="sitemail.php" method="post" name="post">
function checkForm() {
email = document.getElementById("email").value;
if (email == "") {
hideAllErrors();
document.getElementById("emailError").style.display = "none";
document.getElementById("email").select();
document.getElementById("email").focus();
return false;
}
return true;
}
</script>
function hideAllErrors() {
document.getElementById("emailError").style.display = "none"
}
function getdata() {
<table height="610" cellspacing="3" cellpadding="0" width="380" border="0">
<tbody>
<tr>
<td align="right" colspan="2">
<p align="left"><font face="Comic Sans MS" size="2">Your Email <font color="#ff0000">*</font></font></p>
</td>
<td><input id="email" style="BACKGROUND-COLOR: #ffffff" maxlength="50" size="50" name="email" /> <font face="Comic Sans MS" size="2"></font>
<div class="emailError" id="emailError"><br /><font face="Comic Sans MS" size="2">Error: Forgot to enter this field. Please enter your E-Mail to proceed.<br /></font></div>
</tr>
</tbody>
</table>
</form>
<br />
</TD>
}
?>
Please help, I've been stuck on it for 2 days. I don't know what I did wrong..