Guest User

Untitled

a guest
Mar 6th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.39 KB | None | 0 0
  1. if(isset($_POST['submit'])){
  2.     $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']);
  3.     $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']);
  4.     $email = preg_replace (array_keys($nicht_erlaubt), array_values($nicht_erlaubt), $_POST['email']);
  5.     $idk=array('"', "'", ';', '-');
  6.     $user = str_replace($idk, '', $user);
  7.     $pass = str_replace($idk, '', $pass);
  8.     $resp = recaptcha_check_answer ($privkey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
  9.     if($_POST['username'] == "")
  10.         echo '<font color="red">Gebe einen User an</font>';
  11.     else if($_POST['password'] == "")
  12.         echo '<font color="red">Gebe ein Passwort ein</font>';
  13.     else if($_POST['password'] != $_POST['password2'])
  14.         echo '<font color="red">Die Passwoerter stimmen nicht ueberein</font>';
  15.     else if ((strlen($_POST['username']) > 15) || (strlen($_POST['username']) < 6))
  16.         echo '<font color="red">Dein Passwort sollte zwischen 6 bis 15 zeichen lang sein</font>';
  17.     else if ((strlen($_POST['password']) > 15) || (strlen($_POST['password']) < 6))
  18.         echo '<font color="red">Dein Passwort sollte zwischen 6 bis 15 zeichen lang sein</font>';
  19.     else if($_POST['username'] != $user)
  20.         echo '<font color="red">Es sind nicht erlaubte zeichen vorhanden</font>';
  21.     else if($_POST['password'] != $pass)
  22.         echo '<font color="red">Es sind nicht erlaubte zeichen vorhanden</font>';
  23.     else if($_POST['email'] == "")
  24.         echo '<font color="red">Bitte gebe eine Email an</font>';
  25.     else if($_POST['email'] != $email)
  26.         echo '<font color="red">Es sind nicht erlaubte zeichen vorhanden</font>';
  27.     else if(strlen($_POST["recaptcha_response_field"]) == 0)
  28.         echo '<font color="red">Hast du den reCaptcha vergessen ?</font>';
  29.     else if(!$resp->is_valid){
  30.         echo '<font color="red">Der eingegebene reCaptcha ist falsch:'.$resp->error.'</font>';
  31.     else {
  32.         $pass = md5($salt.$pass);
  33.         if(!doesUsernameExist($user)){
  34.             $gen_key = random_string();
  35.             odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
  36.             odbc_exec($mssql, 'INSERT INTO [ACCOUNT_TBL_VALIDATE] ([account], [password], [email], [key], [datum]) VALUES (\''.$user.'\', \''.$pass.'\', \''.$email.'\', \''.$gen_key.'\', \''.date('Y-m-d').'\')');
  37.             SendEmail($email, $gen_key);
  38.             echo '<div class="success">Es wurde eine Email mit dem Aktivierungscode versand.</font>';
  39.         } else {
  40.             echo '<font color="red">Registration fehlgeschlagen</font>';
  41.         }
  42.     }
  43.     mssql_close();
  44. }
Add Comment
Please, Sign In to add comment