<?PHP }
if (!isset($fname) or !isset($lname) or !isset($company) or !isset($workphone) or !isset($emailaddress) or !isset($subject) or !isset($comments)) {
show_form();
}
else {
if (empty($fname) || empty($lname) || empty($emailaddress) || empty($comments)) {
echo "<h2>Please fill in the required fields.</h2>";
if (empty($fname)) {
echo "First name is empty.<br />";
}
if (empty($lname)) {
echo "Last name is empty.<br />";
}
if (empty($emailaddress)) {
echo "Email is empty.<br />";
}
if (empty($comments)) {
echo "Did you forget to write your message?<br />";
}
if (!ereg("[a-Z]", $fname)) {
echo "You did not enter in a valid first name.<br />";
}
if (!ereg("[a-Z]", $lname)) {
echo "You did not enter in a valid last name.<br />";
}
if (!ereg('[-!#$%&\'*+\./0-9=?A-Z_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\/0-9=?A-Z_`a-z{|}~]+.'.
'[-!#$%&\'*+\./0-9=?A-Z_`a-z{|}~]+$', $emailaddress)) {
echo "You did not enter a valid email address<br /><br>";
}
how do i put this in php friendliness besides cutting and pasting each code with appropriate color?