hello, i am new to working with php and i am trying to teach myself some basic functions. i have a contact engine file and i only want an error if the email is field is empty but currently get an error if all the forms are not completed. i changed the ‘if’ line to only show email but it did not change anything. can someone look at this code and help me understand what i am doing incorrectly?
[php]<?php
$name = $_REQUEST['Name'] ;
$email = $_REQUEST['Email'] ;
$phone = $_REQUEST['Phone'] ;
$contact = $_REQUEST['Contact'] ;
$inquiry = $_REQUEST['Inquiry'] ;
$message = "Name: $name \n
E-mail: $email \n
Phone: $phone \n
Best Time to Contact: $contact \n
Inquiry: \n
$inquiry";
if (empty($email)) {
header( "Location: error.php" );
}
else {
mail( "[email protected]", "Information Inquiry",
$message, "From: $email" );
header( "Location: thankyou.php" );
}
?>
[/php]