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


  1. zn92
    Member

    Is there a way to modify the email field so that yahoo addresses are not accepted?

    Thanks!

    Posted 10 years ago #
  2. davidballard
    Member

    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 #
  3. yuniar

    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 #
  4. zn92
    Member

    Thank you!

    Posted 10 years ago #
  5. HeuF
    Member

    What if I want more for example: yahoo and gmail

    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{
    //block Gmail

    if(strpos(strtolower($value[0]), 'gmail') !== false ){
    return "Sorry. Please use a non-Gmail address";
    }else{
    return true;
    }
    return true;
    }
    --------------------------------------------------------------------------------

    Posted 10 years ago #
  6. HeuF
    Member

    Am I right?

    Posted 10 years ago #

RSS feed for this topic

Reply