WordPress.org

Ready to get started?Download WordPress

Forums

Approval / Invitation / Access code? (wp-register.php) (2 posts)

  1. narakalex
    Member
    Posted 8 years ago #

    When people click on "register" there is only 2 options..
    enter username:
    enter email:

    how can i add a simple 3 option? like "invitation" code?
    I'd like only my friends & relatives to be able to register and make comments to my blog.
    I'd like to be able to give out 1 or 2 invitation codes (like for example: "wordpressrules" or "wp2005").
    So when people click "register" is will ask for 3 things
    enter username:
    enter email:
    enter invitationcode:

    How to come about this?

    ***** This is my attempt to make it in wp-register.php*****
    case 'register':

    $user_login = $_POST['user_login'];
    $user_email = $_POST['user_email'];
    $invitationcode = $_POST['invitationcode'];

    /* checking that username has been typed */
    if ($user_login == '') {
    die (__('ERROR: Please enter a username.'));
    }

    /* checking e-mail address */
    if ($user_email == '') {
    die (__('ERROR: Please type your e-mail address.'));
    } else if (!is_email($user_email)) {
    die (__('ERROR: The email address isn’t correct.'));
    }
    if ($invitationcode,'wp2005') != 'wp2005')
    die (__('

  2. You must enter your invitationcode in the last box (below email)'));
  3. *****
    PS. I don't know how to code in php.. i can barely make a system-out-print with hello world...

  • narakalex
    Member
    Posted 8 years ago #

    Posted in Wrong forum!
    Goto http://wordpress.org/support/topic/41260#post-231770
    if you know how to solve this question (Plugins and Hacks)!

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags