Unless I’ve missed something it seems to work for me!
In order to test it I added some code:
if (strpos($formBusinessName,"#") !== false) {
$error = "Yes";
$errorMessage .= "<li>Your business name can not contain a distributor number.</li>";
}
else {
$error = "No";
$errorMessage .= "<li>Your business name is okay.</li>";
}
echo $error, "\n";
echo $errorMessage;
and tried it with $formBusinessName = “abc123”; and $formBusinessName = “abc#123”;
I just tried several variations and it worked fine for me.
I notice $errorMessage appends and $formBusinessName suggests it’s a $_POST value that has been validated / sanitized - i.e. the code involved has not been posted.
busboy, if you echo or var_dump $formBusinessName before the if test what does it look like?