I am trying to get the email validation working via php but having issues.
Here is my script
<?php
$domains = array('@domain1.com', '@domain2.com');
$pattern = "/^[a-z0-9._%+-](" . implode('|', $domains) . ")$/i";
if($_GET["inputid"] == "112" && $_GET["value"] == "$pattern")
{
echo "lz_validate_input_result(true,112);";
exit();
}
else
{
echo "lz_validate_input_result(false,112);";
exit();
}
?>
hits the script with email.php?inputid=112&[email protected]
So I need it that if it’s not [domain1.com]or [domain2.com] it returns a false.
Can someone help me rewrite this for it works. I am a php newbie.