I got the errors to disappear for the most part however the date variable is still popping up as undefined index error... I have the date scripted in the form to show automatically using the date function with in the value attribute of the date text box..
http://www.sono-tek.com/forms/webmaster.php
here is my processing code.
<?PHP
//updated on 01/10/06 Antoni Sousa
session_start();
if(isset($_POST['sendform'])) {
//pull from form
$name = $_POST['name'];
$email = $_POST['email'];
$date = $_POST['date'];
$subject = $_POST['subject'];
$comments = $_POST['comments'];
}
//for email
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers = "From: $name <$email>";
$body = "$name\n$date\n$subject\n$email\n$comments";
//validation errors
$emailerror = "";
$validerror = "";
$commenterror = "";
//hold information entered into form if error reload occurs
session_register("name");
session_register("email");
session_register("date");
session_register("subject");
session_register("comments");
//validate form and random number
if (isset($_POST['txtNumber'])) {
$number = $_POST['txtNumber'];
if (empty($email)){
$emailerror = "<tr>
<td colspan=2 class=emptyfield>! Please provide an email address !</td>
</tr>";
} else {
$emailerror = NULL;
}
if (empty($comments)) {
$commenterror = "<tr>
<td colspan=2 class=emptyfield>! Please describe your question or error !</td>
</tr>";
} else {
$commenterror = NULL;
}
//send mail out
if( ($emailerror == NULL && $commenterror == NULL) && (md5($number) == $_SESSION['image_random_value']) ) {
mail('websupport@sono-tek.com',$subject,$body,$headers);
header("location:http://www.sono-tek.com/contact/thanks.php");
exit;
} else {
$validerror = "<tr>
<td colspan=2 class=emptyfield>! You must enter the CORRECT Validation Number to continue !</td>
</tr>";
}
}
?>