Having problems with a signup form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Edso
Forum Newbie
Posts: 1
Joined: Tue Feb 10, 2009 4:20 am

Having problems with a signup form

Post by Edso »

$preg = getLoginRegex();
if (!preg_match($preg, $vars['login'])){
$error[] = $config['login_disallow_spaces'] ?
_SIGNUP_INVALID_USERNAME_W_SPACES : _SIGNUP_INVALID_USERNAME;
} elseif (strlen($vars['login']) < $config['login_min_length']){
$error[] = sprintf(_SIGNUP_INVALID_USERNAME_2,$config['login_min_length']);
} elseif (!$member_id=$db->check_uniq_login($vars['login'], $vars['email'],
$vars['pass0'], 1)){
$error[] = sprintf(_SIGNUP_INVALID_USERNAME_3,$vars[login]);
}
if (!check_email($vars['email'])){
$error[] = _SIGNUP_PLEASE_ENTER_EMAIL;
} elseif (($config['unique_email'] && $member_id <= 0) &&
$db->users_find_by_string($vars['email'], 'email', 1)){
$error[] = _SIGNUP_INVALID_EMAIL_1.'<br />'.sprintf(_SIGNUP_INVALID_EMAIL_2,'<a href="member.php">','</a>','<br />');
}

where could be the error guys please help me.
Thanks
Ed
User avatar
Skoalbasher
Forum Contributor
Posts: 147
Joined: Thu Feb 07, 2008 8:09 pm

Re: Having problems with a signup form

Post by Skoalbasher »

What's supposed to happen here, and what doesn't work about it? Does it give you an error? Does it email to the wrong spot and it gets spit back? Also try and put your code in the code tags.

Code: Select all

 
$preg = getLoginRegex();
if (!preg_match($preg, $vars['login'])){
$error[] = $config['login_disallow_spaces'] ?
_SIGNUP_INVALID_USERNAME_W_SPACES : _SIGNUP_INVALID_USERNAME;
} elseif (strlen($vars['login']) < $config['login_min_length']){
$error[] = sprintf(_SIGNUP_INVALID_USERNAME_2,$config['login_min_length']);
} elseif (!$member_id=$db->check_uniq_login($vars['login'], $vars['email'], 
$vars['pass0'], 1)){
$error[] = sprintf(_SIGNUP_INVALID_USERNAME_3,$vars[login]);
}
if (!check_email($vars['email'])){
$error[] = _SIGNUP_PLEASE_ENTER_EMAIL;
} elseif (($config['unique_email'] && $member_id <= 0) && 
$db->users_find_by_string($vars['email'], 'email', 1)){
$error[] = _SIGNUP_INVALID_EMAIL_1.'<br />'.sprintf(_SIGNUP_INVALID_EMAIL_2,'<a href="member.php">','</a>','<br />');
}
 
Post Reply