</tr>
</table>
</form>
<?php
} else {
// BELOW WE SET ALL THE $_POST VARIABLES FOR VALIDATION EMAIL & MYSQL INJECTION
$fname = trim($_POST['firstname']);
$lname = trim($_POST['lastname']);
// error_reporting(0);
// error_reporting(E_ALL & ~E_NOTICE);
// Here we will begin an array to contain any errors we might encounter
// This allows the form to display all the page errors at the same time
$errors = array();
// The next test is a small security feature to ensure the form being submitted to us is actually our form
// When doing testing, you quite possibly will get an "Inavlid referer" error
// If this error appears in testing, simply comment out the first 3 lines below, but remember to uncomment it when going live
$page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
if (!ereg($page, $_SERVER['HTTP_REFERER']))
$errors[] = "Invalid referer";
// check to see if a first name was entered
if (empty($fname))
$errors[] = "Your First Name is required";
// check to see if a last name was entered
if (empty($lname))
$errors[] = "Your Last Name is required";