You are here: Re: im having trouble with user validation « All PHP « IT news, forums, messages
Re: im having trouble with user validation

Posted by flamer die.spam@hotmail.com on 12/03/06 22:18

Anonymous wrote:
> I'm having lots of trouble with a registration form, after the user
> registers ALL the error messages pop up. Here is my code. SOMEONE PLEASE
> HELP!
>
> // Check for a first name.
> if (eregi (' [[:alpha:]\.\' \-]{2,15}$', stripslashes
> (trim($_POST['user_name'])))) {
> $un = escape_data($_POST['user_name']);
> } else {
> $un = FALSE;
> echo '<p><font color="red" size="-1">Please
> enter your user name</font></p>';
> }
> // Check for a first name.
> if (eregi (' [[:alpha:]\.\' \-]{2,15}$', stripslashes
> (trim($_POST ['first_name'])))) {
> $fn = escape_data($_POST['first_name']);
> } else {
> $fn = FALSE;
> echo '<p><font color="red" size="-1">Please
> enter your first name!</font></p>';
> }
>
> // Check for a last name.
> if (eregi (' [[:alpha:]\.\' \-]{2,30}$', stripslashes
> (trim($_POST ['last_name'])))) {
> $ln = escape_data($_POST['last_name']);
> } else {
> $ln = FALSE;
> echo '<p><font color="red" size="-1">Please
> enter your last name! </font></p>';
> }
>
> // Check for an email address.
> if (eregi (' [[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]
> +\.[a-z]{2,4}$', stripslashes(trim($_POST['email'])))) {
> $e = escape_data($_POST['email']);
> } else {
> $e = FALSE;
> echo '<p><font color="red" size="-1">Please enter
> a valid email address! </font></p>';
> }
>
> // Check for a password and match against the confirmed password.
> if (eregi (' [[:alnum:]]{5,20}$', stripslashes(trim($_POST
> ['password1'])))) {
> if ($_POST['password1'] == $_POST['password2']) {
> $p = escape_data($_POST['password1']);
> } else {
> $p = FALSE;
> echo '<p><font color="red" size="-1">Your password
> did not match the confirmed password! </font></p>';
> }
> } else {
> $p = FALSE;
> echo '<p><font color="red" size="-1">Please enter
> a valid password! </font></p>';
> }
>
> if ('$un' && '$fn' && '$ln' && '$e' && '$p') {

what are the error messages and show me the code on the line that the
errors refer to.

Flamer.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация