This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 4
Blocking yahoo accounts in email field
Started 10 years ago by zn92 | 6 posts |
-
Is there a way to modify the email field so that yahoo addresses are not accepted?
Thanks!
Posted 10 years ago # -
zn92,
There may be ways that I am not aware of, but you could have your form be several pages long. An example: First, have the form user enter their email address and then use form logic to direct to them to the actual form page where you are collecting whatever information you are looking for and if they submit a yahoo address, use logic to direct the user to a page that "nicely" (if you are looking to be nice) tells the yahoo.com users that you can not accept emails from yahoo.com.
Well, guess that won't work. Sorry about that zn92, the continue button gets in the way.
-David
Posted 10 years ago # -
You can edit your "includes/common-validator.php" file. Search around line 349 for this block of code:
if(empty($result)){ return sprintf($error_message,'%s',$value[0]); }else{ return true; }
replace it with this one:
if(empty($result)){ return sprintf($error_message,'%s',$value[0]); }else{ //block Yahoo if(strpos(strtolower($value[0]), 'yahoo') !== false ){ return "Sorry. Please use a non-Yahoo address"; }else{ return true; } return true; }
MachForm Founder
Posted 10 years ago # -
Thank you!
Posted 10 years ago # -
What if I want more for example: yahoo and gmail
if(empty($result)){
return sprintf($error_message,'%s',$value[0]);
}else{
//block Yahooif(strpos(strtolower($value[0]), 'yahoo') !== false ){
return "Sorry. Please use a non-Yahoo address";
}else{
//block Gmailif(strpos(strtolower($value[0]), 'gmail') !== false ){
return "Sorry. Please use a non-Gmail address";
}else{
return true;
}
return true;
}
--------------------------------------------------------------------------------Posted 10 years ago # -
Am I right?
Posted 10 years ago #
Reply
You must log in to post.