Jump to content
MakeWebGames

Register problem.


03laceys
 Share

Recommended Posts

In my register i have added it so you are unable to sign up if:

Username is under 6 characters long,

Username over 12 characters long,

Password under 6 characters long,

Password over 12 characters long,

Username is already use,

Email is already use,

Passwords don't match,

Bad words blocked,

Only characters 0-9 and A-Z can be used.

There is a problem i have come across though, if a member that is trying to register meets two of these they are shown the login twice.

 

Code setup

else if(strlen($_POST['username']) < 6)
{
print "<center><form action=register.php method=post><table width='400' border='1'>
<tr>
<td colspan='2' align='center'><span style='color:red; font-weight: 800;'>! ERROR: Username must be more than 6 

characters.</span></td>
</tr>
<tr>
<td width='50%'><font color=white>Username:</td><td><input type=text name=username></td>
</tr>
<tr>
<td width='50%'><font color=white>Password:</td><td><input type=password name=password></td>
</tr>
<tr>
<td width='50%'><font color=white>Confirm Password:</td><td><input type=password name=cpassword></td>
</tr>
<tr>
<td width='50%'><font color=white>E-Mail Address:</td><td><input type=text name=email>
<font color=red></td>
</tr>
<tr>
<td width='50%'><font color=white>Your Referrers ID:</td><td><input type=text name=referrer value='".$_GET["REF"]."'></td>
</tr>
<tr>
<td width='50%'><font color=white>Promo Code:</td><td><input type=text name=promo></td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='Register' /></td>
</tr></table></form>";
}
else if(strlen($_POST['password']) > 12)
{
print "<center><form action=register.php method=post><table width='400' border='1'>
<tr>
<td colspan='2' align='center'><span style='color:red; font-weight: 800;'>! ERROR: Password must be less than 12 

characters.</span></td>
</tr>
<tr>
<td width='50%'><font color=white>Username:</td><td><input type=text name=username></td>
</tr>
<tr>
<td width='50%'><font color=white>Password:</td><td><input type=password name=password></td>
</tr>
<tr>
<td width='50%'><font color=white>Confirm Password:</td><td><input type=password name=cpassword></td>
</tr>
<tr>
<td width='50%'><font color=white>E-Mail Address:</td><td><input type=text name=email>
<font color=red></td>
</tr>
<tr>
<td width='50%'><font color=white>Your Referrers ID:</td><td><input type=text name=referrer value='".$_GET["REF"]."'></td>
</tr>
<tr>
<td width='50%'><font color=white>Promo Code:</td><td><input type=text name=promo></td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='Register' /></td>
</tr></table></form>";
}

I'm sure as you can tell the other denials carry-on with else's.

You can view the error better at http://www.hitmanslegacy.co.uk try to sign up by not following 2 or more of the rules stated above.

Now i believe i could fixed this error by using die, but i do not with to do it that way as it will end the page to quickly and my footer will not show.

Any help in fixing this will be greatly appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...