Validation On Signup Not Working

Discussion in 'Troubleshooting' started by cmap, Dec 2, 2003.

  1. cmap

    cmap Guest

    hi
    I see in signup.php there's validation, but its only refreshing my page if fields aren't filled in ? I haven't modified this and my signup.html calls the variables the same as they are below.


    # CHECK_PAYMENT_FORM
    #
    # set $GLOBAL[error] if needed
    # return 1/0 (valid/not-valid)
    #
    function check_payment_form(){
    global $error;
    global $vars;
    global $db;

    //
    if (!intval($vars['product_id'])) {
    $error[] = 'Please select Membership Type';
    }
    if (!strlen($vars['paysys_id'])){
    $error[] = 'Please select Payment System';
    }
    if (!strlen($vars['name_f'])){
    $error[] = 'Please enter your First Name';
    }
    if (!strlen($vars['name_l'])){
    $error[] = 'Please enter your Last Name';
    }
    if (!check_email($vars['email'])){
    $error[] = 'Please enter valid Email';
    }
    if (!preg_match('/^w{4}w*$/', $vars['login'])){
    $error[] = "Please enter correct login. It should contain at least 4 letters, digits or _";
    }
    else if (!$db->check_uniq_login($vars['login'])){
    $error[] = "Login '$vars[login]' already used. Please enter another login";
    }
    if (!strlen($vars['pass0'])){
    $error[] = 'Please enter Password';
    }
    if ($vars['pass0'] != $vars['pass1']){
    $error[] = 'Password and Password Confirmation are different. Please reenter both';
    }
    return !count($error);
    }

    Free version. is there something else ineed to turn on ?
    Thanks
    Elaine
  2. cmap

    cmap Guest

    i got my form validation working - there was some error text in the original php i was missing on my form to pick up the validation. :0
    Elaine

Share This Page