I am having a problem with the following code.
i have seen this topic was vastly mentioned in this forum, still i could not find a solution.
what i cannot figure out is why in all the scenarios the code functions right, and the comments $comment 1 and $comment2 are approachable from the next if statement that sends the form back to the user, but only in one if statment (stated by a note in the code) this does not happen correctly.
Thank you for your time and effort.

```
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$veremail = $_POST['veremail'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// All these variables receive values from a form

// The following IF() statements are supposed to answer all the possible
// outcomes of an email verification script, which checks if the email
// address was entered in two different fields in the same way

 if ($email===$veremail and !empty($email) and !empty($veremail)){
    $comment1='';
    $comment2=''; 

}
if ($email===$veremail and empty($email) and empty($veremail)){
    $comment1='*Please type';
    $comment2='*Please type'; 

 }

//The next if statement is the one i am having trouble with, whenever the code
//in this statement is executed, $comment 1 and $comment 2 are not displayed
//in the if statement that resend the user to the form when a problem of typing
//the data was encountered** 

     if($email!=$veremail and !empty($email) and !empty($veremail)){
        $comment1='*email addresses not match';
        $comment2='*email addresses not match'; 

     }**
 if ($email!=$veremail and !empty($email) and empty($veremail)){
    $comment1='';
    $comment2='*Please type'; 

 }
 if($email!=$veremail and empty($email) and !empty($veremail)){
    $comment1='*Please type';
    $comment2='';
 }

echo    $comment1.' ' .$comment2;  //I added this to make sure these variables
// received the expected value by the preceding if statements, I never
// encounterd a problem in here: the expected values were always presented
// correctly here

 /* 
The next code checks variables submitted from form customer feedback

 This next code analyses the variables submitted by the form using the
 empty() function If any of them are empty it will return the client to
 the form, the values which were already typed are kept and a note next
 to a field which was not submitted is added

 */

if (    empty($fname) 
    OR  empty($fname) 
    OR  empty($lname) 
    OR  empty($email) 
    OR  empty($veremail) 
    OR  empty($subject) 
    OR  empty($message) 
    OR  $email!=$veremail){
echo "
<center>    \n
<br><br><br>\n
<h1>Your feed back please</h1>\n
<Br><br>\n
    \t<form action=".'feedbackprocess.php'." method=".'POST'.">\n
    \t\t<table>\n
    \t\t\t      <tr>\n
    \t\t\t\t        <td>First name:             </td>           <td><input type=".'text'." name=".'fname'." value="."$fname".">";
                    if(empty($fname)){
                    echo "*please fill";
                    }
                    echo"</td>\n
    \t\t\t      </tr>\n
    \t\t\t      <tr>\n
    \t\t\t\t        <td>Last name:              </td>           <td><input type=".'text'." name=".'lname'." value="."$lname".">";
                    if(empty($lname)){
                    echo "*please fill";
                    }
                    echo"</td>\n
    \t\t\t      </tr>\n
    \t\t\t      <tr>\n
    \t\t\t\t        <td>Email address:          </td>           <td><input type=".'text'." name=".'email'." value="."$email".">";
                    if(empty($email)){
                    echo "$comment1";
                    }
                    echo"</td>\n
                </tr>\n
    \t\t\t      <tr>\n
    \t\t\t\t        <td>Verify email address:   </td>           <td><input type=".'text'." name=".'veremail'." value="."$veremail".">";
                    if(empty($veremail)){
                    echo "$comment2";
                    }
                    echo"</td>\n
    \t\t\t      <tr>\n
                <tr>\n
    \t\t\t\t        <td>Subject:                </td>           <td><input type=".'text'." name=".'subject'." value="."$subject".">";
                    if(empty($subject)){
                    echo "*please fill";
                    }
                    echo"</td>\n
    \t\t\t      </tr>\n
    \t\t</table>\n
        <br><br>\n
                            Content:<br>\n

                    <textarea rows=".'6'." cols=".'50'." name=".'message'.">$message"."</textarea>";
                    if(empty($message)){
                    echo "<br><br>*please fill";
                    }
                    echo"
                    <br><br>\n
                    <input type=".'submit'.">\n
                    </form>\n
</center>\n
";
}else{
echo 'Thank you for your comment';
}

```