Advertisement
Corey

Untitled

Mar 31st, 2011
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1.         function register()
  2.         {
  3.             $username = $this->clean('DH_US_username', 'POST');
  4.             $password = md5($_POST['DH_US_password']);
  5.             $email = $this->clean('DH_US_email', 'POST');
  6.  
  7.             $ip = $GLOBALS['getvar']->get('REMOTE_ADDR', 'SERVER');
  8.             $browser = $GLOBALS['getvar']->get('HTTP_USER_AGENT', 'SERVER');
  9.            
  10.             if (empty($username))
  11.             {
  12.                 $this->errors[] = "Registration Error: Invalid Username.";
  13.             }
  14.             if (empty($_POST['DH_US_password']))
  15.             {
  16.                 $this->errors[] = "Registration Error: Invalid Password.";
  17.             }
  18.             if (empty($email))
  19.             {
  20.                 $this->errors[] = "Registration Error: Invalid Email.";
  21.             }
  22.             if ($this->db->Execute("SELECT * FROM `" . $this->db->db_info['tables']['users'] . "` WHERE `username`='" . $username . "'")->RecordCount() > 0)
  23.             {
  24.                 $this->errors[] = "Registration Error: Username Exists";
  25.             }
  26.             if (!$this->errors)
  27.             {
  28.                 $this->db->Execute("INSERT INTO `" . $this->db->db_info['tables']['users'] . "` (`username`, `password`, `email`) VALUES ('" . $username . "', '" . $password . "', '" . $email . "')");
  29.             }
  30.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement