ok, you will need to create a recordset to return the allowed domains. After the recordset code, add the following code to loop through it and create a new variable that contains a pipe separated list of domains:
<?php
$okDomains = "";
do {
$okDomains .= $row_recordsetName['domainName']."|";
} while ($row_recordsetName = mysql_fetch_assoc($recordsetName));
$okDomains = substr_replace($okDomains,"",-1);
?>
when you add the regular expression validation it will create a line similar to this:
$WAFV_Errors .= WAValidateRX(((isset($_POST["emailField"]))?$_POST["emailField"]:"") . "","/^[A-Z0-9._%-]+@(apple.com|ibm.com|webassist.com)$/i",true,1);
edit that to use the $okDomains variable instead of the static listing of domains:
$WAFV_Errors .= WAValidateRX(((isset($_POST["emailField"]))?$_POST["emailField"]:"") . "","/^[A-Z0-9._%-]+@(".$okDomains.")$/i",true,1);
make sure that the code order is correct, the validation may be placed before the recordset. The order needs to be:
-recordset
-do to create the $okDomains variable
-Validation