Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function register()
- {
- $username = $this->clean('DH_US_username', 'POST');
- $password = md5($_POST['DH_US_password']);
- $email = $this->clean('DH_US_email', 'POST');
- $ip = $GLOBALS['getvar']->get('REMOTE_ADDR', 'SERVER');
- $browser = $GLOBALS['getvar']->get('HTTP_USER_AGENT', 'SERVER');
- if (empty($username))
- {
- $this->errors[] = "Registration Error: Invalid Username.";
- }
- if (empty($_POST['DH_US_password']))
- {
- $this->errors[] = "Registration Error: Invalid Password.";
- }
- if (empty($email))
- {
- $this->errors[] = "Registration Error: Invalid Email.";
- }
- if ($this->db->Execute("SELECT * FROM `" . $this->db->db_info['tables']['users'] . "` WHERE `username`='" . $username . "'")->RecordCount() > 0)
- {
- $this->errors[] = "Registration Error: Username Exists";
- }
- if (!$this->errors)
- {
- $this->db->Execute("INSERT INTO `" . $this->db->db_info['tables']['users'] . "` (`username`, `password`, `email`) VALUES ('" . $username . "', '" . $password . "', '" . $email . "')");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement