Forums

Require a .edu email address for regristration (1 post)

  1. Pedroskii
    Member
    Posted 2 years ago #

    I'm trying to change my user regristration to require users to use a college email address. I've researched the topic and haven't found anyhting. The closest I have come is finding some php code that checks email addresses but I am having issues making out what to do next. Heres the code:

    <?php
    $email = firstname.lastname@aaa.bbb.com;
    $regexp = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";

    if (preg_match($regexp, $email)) {
    echo "Email address is valid.";
    } else {
    echo "Email address is <u>not</u> valid.";
    }
    ?>

    Could someone please walk me through the process of this code and how I can modify it to meet my needs? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic