Ahoy all. I've got a contact form PHP script. I use it for multiple sites since it's quick and easy. Basically, it loops through ALL the form fields in a contact form, no matter what they are. Makes it so I don't have to manually do the POST thing one by one.
ANYWAY, my question is simple. Below is a snippet of the code:
if ($thisField != "contact-submit") {
if (($thisField != "human2")) {
$msg .= "<b>".$thisField ."</b>: ". $thisValue ."<br>";
}
}
Now, the problem with it doing this loop is it picks up ALL things submitted, including the SUBMIT BUTTON and my hidden form field to deter robots. I don't want to display THOSE fields to my clients.
So instead of doing these two nested loops, I was thinking of doing a
if (($thisField != "human2") or ($thisField != "contact-submit")
but it just doesn't work... I have also tried the || operator as well.
What am I missing?