\n\t\t\t\t\t\tTitle: | \n\t\t\t\t\t\t".(stripslashes($_POST['title']))." | \n\t\t\t\t\t";
/* Check the FIRST name has no extra spaces, has a capital letter for its first letter and that any slashes are stripped for
pretty output before printing to page. If there is no entry $error is called.*/
if ($_POST['fname'] != '')
{
$_POST['fname'] = trim($_POST['fname']);
$_POST['fname'] = ucfirst($_POST['fname']);
echo 'First Name: | '.(stripslashes($_POST['fname'])).' |
';
}
else
{
echo 'First Name: | This is a required field. |
';
$error = 'TRUE';
}
/* Check the LAST name has no extra spaces, has a capital letter for its first letter and that any slashes are stripped for
pretty output before printing to page. If there is no entry $error is called.*/
if ($_POST['lname'] != '')
{
$_POST['lname'] = trim($_POST['lname']);
$_POST['lname'] = ucfirst($_POST['lname']);
echo 'Last Name: | '.(stripslashes($_POST['lname'])).' |
';
}
else
{
echo 'Last Name: | This is a required field. |
';
$error = 'TRUE';
}
/* Check the JOB TITLE has no extra spaces, has a capital letter for its first letter and that any slashes are stripped for
pretty output before printing to page. If there is no entry $error is called.*/
if ($_POST['jtitle'] != '')
{
$_POST['jtitle'] = trim($_POST['jtitle']);
$_POST['jtitle'] = ucfirst($_POST['jtitle']);
echo 'Job Title: | '.(stripslashes($_POST['jtitle'])).' |
';
}
else
{
echo 'Job Title: | This is a required field. |
';
$error = 'TRUE';
}
/* Check that the given email address has a valid domain and split it into the username and domain.*/
list($userName, $mailDomain) = split("@", $email);
if (!checkdnsrr($mailDomain, "MX"))
{
echo 'Email: | Please enter a correct email address. |
';
$error = 'TRUE';
}
else if (!ereg("^..*\@.+\..+[A-Za-z0-9]$", $_POST['email']))
{
echo 'Email: | Please enter a correct email address. |
';
$error = 'TRUE';
}
else
echo 'Email: | '.$_POST['email'].' |
';
/* Check the COMPANY / SCHOOL name has no extra spaces, has a capital letter for its first letter and that any slashes are stripped for
pretty output before printing to page. If there is no entry $error is called.*/
if ($_POST['company'] != '')
{
$_POST['company'] = trim($_POST['company']);
$_POST['company'] = ucfirst($_POST['company']);
echo 'Company/School: | '.(stripslashes($_POST['company'])).' | |
';
}
else
{
echo 'Company / School: | This is a required field. |
';
$error = 'TRUE';
}
/* If SCHOOL NUMBER is filled in this checks whether it's an integer If it isn't an integer $error is called. If there is no entry nothing is echoed */
if (is_numeric($_POST['schoolnum']))
{
$_POST['schoolnum'] = trim($_POST['schoolnum']);
echo 'School Numbers: | '.(stripslashes($_POST['schoolnum'])).' | |
';
}
elseif ($_POST['schoolnum'] == '')
echo '';
else
{
echo 'School Numbers: | Numbers are only permitted in this field. |
';
$error = 'TRUE';
}
/* If TOTAL STUDENTS is filled in this checks whether it's an integer If it isn't an integer $error is called. If there is no entry nothing is echoed */
if (is_numeric($_POST['studentnum']))
{
$_POST['studentnum'] = trim($_POST['studentnum']);
echo 'Total Students: | '.(stripslashes($_POST['studentnum'])).' | |
';
}
elseif ($_POST['studentnum'] == '')
echo '';
else
{
echo '| Numbers are only permitted in this field. |
';
$error = 'TRUE';
}
/* If MIN STUDENT AGE is filled in this checks whether it's an integer If it isn't an integer $error is called. If there is no entry nothing is echoed */
if (is_numeric($_POST['studentagemin']))
{
$_POST['studentagemin'] = trim($_POST['studentagemin']);
echo 'Student Age (min.): | '.(stripslashes($_POST['studentagemin'])).' | |
';
}
elseif ($_POST['studentagemin'] == '')
echo '';
else
{
echo 'Student Age (min.): | Numbers are only permitted in this field. |
';
$error = 'TRUE';
}
/* If MAX STUDENT AGE is filled in this checks whether it's an integer If it isn't an integer $error is called. If there is no entry nothing is echoed */
if (is_numeric($_POST['studentagemax']))
{
$_POST['studentagemax'] = trim($_POST['studentagemax']);
echo 'Student Age (max.): | '.(stripslashes($_POST['studentagemax'])).' | |
';
}
elseif ($_POST['studentagemax'] == '')
echo '';
else
{
echo 'Student Age (max.): | Numbers are only permitted in this field. |
';
$error = 'TRUE';
}
/* Check the ADDRESS1 has no extra spaces and that any slashes are stripped for
pretty output before printing to page.*/
if ($_POST['address1'] != '')
{
$_POST['address1'] = trim($_POST['address1']);
echo 'Address Line 1: | '.(stripslashes($_POST['address1'])).' |
';
}
else
echo '';
/* Check ADDRESS2 has no extra spaces and that any slashes are stripped for
pretty output before printing to page.*/
if ($_POST['address2'] != '')
{
$_POST['address2'] = trim($_POST['address2']);
echo 'Address Line 2: | '.(stripslashes($_POST['address2'])).' |
';
}
else
echo '';
/* Check CITY has no extra spaces and that any slashes are stripped for
pretty output before printing to page.*/
if ($_POST['city'] != '')
{
$_POST['city'] = trim($_POST['city']);
$_POST['city'] = ucfirst($_POST['city']);
echo 'City: | '.(stripslashes($_POST['city'])).' |
';
}
else
echo '';
/* Check COUNTRY has no extra spaces and that any slashes are stripped for
pretty output before printing to page.*/
if ($_POST['country'] != '')
{
$_POST['country'] = trim($_POST['country']);
$_POST['city'] = ucfirst($_POST['city']);
echo 'Country: | '.(stripslashes($_POST['country'])).' |
';
}
else
echo '';
/* Print CATALOGUE as ayes or a no */
if ((isset($_POST['catyes'])) && ($_POST['catyes'] == 'yes'))
echo 'Catalogue: | Required |
';
elseif ((isset($_POST['catyes'])) && ($_POST['catyes'] == ''))
echo 'Catalogue: | Not Required |
';
else
echo 'Catalogue: | Not Required |
';
/* Check COMMENT slashes are stripped for pretty output before printing to page. If there is no entry $error is called.*/
if ($_POST['comment'] != '')
echo ' Comment:
|
'.(stripslashes($_POST['comment'])).' |
';
else
{
echo 'Comment: | Please enter a comment. |
';
$error = 'TRUE';
}
echo '