How does registration occur?

When the user has already registered and gave validation. When the site asks to enter a login and password. The user enters how the log and password is checked?


Answer 1, Authority 100%

You can somehow like this:

if  ( !(
      preg_match( "/^[a-z\d-]{6,15}$/i", $_REQUEST['login'] ) &&
      preg_match( "/^[a-z\d-]{6,15}$/i", $_REQUEST['pass'] )
    )  ) echo 'regexp error';
else {
  $res_login = mysql_query(
    'SELECT * FROM `users` WHERE `login` = "'.$_REQUEST['login'].'"'
  );
  if ( mysql_num_rows( $res_login ) != 1 ) echo 'login error';
  else{
    $row_login = mysql_fetch_array( $res_login );
    if ( $row_login['pass'] != $_REQUEST['pass'] ) echo 'password error';
    else {
      // 
    }
  }
}