Guest User

Untitled

a guest
Apr 5th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. error_reporting(0);
  6.  
  7. require_once('./conf/core.php');
  8.  
  9. if(isset($_SESSION["username"]))
  10.  
  11. header("location: me");
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. if(isset($_POST['submit']))
  20.  
  21. {
  22.  
  23. $username = mysql_real_escape_string($_POST['username']);
  24.  
  25. $password = HoloHashMD5($_POST['password']);
  26.  
  27. $password2 = HoloHashMD5($_POST['password']);
  28.  
  29. $email = mysql_real_escape_string($_POST['email']);
  30.  
  31. $last_online = strtotime(date("H:i"));
  32.  
  33. $last_ip = $_SERVER['REMOTE_ADDR'];
  34.  
  35. $ip_reg = $_SERVER['REMOTE_ADDR'];
  36.  
  37. $online = 1;
  38.  
  39. $agb_check = $_POST['agb_check'];
  40.  
  41. $geschlecht = $_POST['geschlecht'];
  42.  
  43. $gender = $_POST['geschlecht'];
  44.  
  45. if($gender === 'm') {
  46.  
  47. $look = 'ch-1201-110.hr-3163-45.cc-3007-76-1408.sh-3016-110.lg-3057-76.hd-185-1.ch-215-1408';
  48.  
  49. } else {
  50.  
  51. $look = 'ca-3175-62.fa-1201-110.cc-3008-63-63.lg-3216-110.hd-625-28.ch-630-110.he-1602-85.hr-3012-1090';
  52.  
  53. }
  54.  
  55.  
  56.  
  57. if (strlen($username) > 0 OR strlen($password) > 0 OR strlen($password2) > 0 OR strlen($email) > 0)
  58.  
  59. {
  60.  
  61. $checkusername = mysql_query("SELECT id FROM users WHERE username = '".$username."' LIMIT 1");
  62.  
  63. if(mysql_num_rows($checkusername) == 0) {
  64.  
  65.  
  66.  
  67. if(strlen($username) > 2)
  68.  
  69. {
  70.  
  71.  
  72.  
  73. if(strlen($password) > 5)
  74.  
  75. {
  76.  
  77.  
  78.  
  79. if($password == $password2)
  80.  
  81. {
  82.  
  83. if(strlen($email) > 0)
  84.  
  85. {
  86.  
  87. if ($agb_check!=0) {
  88.  
  89.  
  90.  
  91. if ($geschlecht == "m" || $geschlecht == "f") {
  92.  
  93.  
  94.  
  95. $motto = mysql_real_escape_string($_POST['motto']); //ggf noch laenge pruefen
  96.  
  97. mysql_query("INSERT INTO users (username, password, mail, motto, last_online, ip_last, ip_reg, online, gender, look) VALUES (
  98.  
  99. '".$username."',
  100.  
  101. '".md5(md5($password2))."',
  102.  
  103. '".$email."',
  104.  
  105. '".$motto."',
  106.  
  107. '".$last_online."',
  108.  
  109. '".$last_ip."',
  110.  
  111. '".$ip_reg."',
  112.  
  113. '".$online."',
  114.  
  115. '".$geschlecht."',
  116.  
  117. '".$look."'
  118.  
  119. )") or die(mysql_error());
  120.  
  121.  
  122.  
  123. $_SESSION['username'] = $username;
  124.  
  125. $_SESSION['password'] = md5(md5($password));
  126.  
  127. header("location: me");
  128.  
  129. }else{
  130.  
  131. $err = "Yanlis!";
  132.  
  133. }
  134.  
  135. }else{
  136.  
  137. $err = "Bitte akzeptieren sie die AGBs.";
  138.  
  139. }
  140.  
  141. } else {
  142.  
  143. $err = "E-Mail ist falsch!";
  144.  
  145. }
  146.  
  147. } else {
  148.  
  149. $err = "Das Passwort ist falsch!";
  150.  
  151. }
  152.  
  153. } else {
  154.  
  155. $err = "Dein Name ist zulang.";
  156.  
  157. }
  158.  
  159. } else {
  160.  
  161. $err = "Dein Name ist zu kurz";
  162.  
  163. }
  164.  
  165. } else {
  166.  
  167. $err = "Benutzer ist vergeben!";
  168.  
  169. }
  170.  
  171. } else {
  172.  
  173. $err = "Oops, bitte alle Felder f&WCF_AMPERSANDüllen!";
  174.  
  175. }
  176.  
  177.  
  178.  
  179. }
  180.  
  181. ?>
Advertisement
Add Comment
Please, Sign In to add comment