Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?php
  2. if(!isset($_POST['username']) || !isset($_POST['passwort']) || !isset($_POST['mail'])) {
  3. header("Location: anmeldungsseite.php?error1=true");
  4. } else {
  5.  
  6. include 'include/mysqldatas.php';
  7.  
  8.  
  9. $nick = $_POST['username'];
  10. $pass = $_POST['passwort'];
  11. $mail = $_POST['mail'];
  12.  
  13.  
  14. $link = mysql_connect($mysqlhost, $mysqlusername, $mysqlpassword);
  15. mysql_select_db($mysqldatabase, $link);
  16. $befehl = mysql_query("SELECT * FROM Benutzerdaten WHERE Username ='$nick'");
  17. if (mysql_num_rows($befehl) > 0){
  18. echo "Username vergeben";
  19. } else {
  20.  
  21. $insert = "INSERT INTO Benutzerdaten (Username, Kennwort, Email)
  22. VALUES ('$nick', '$pass', '$mail')";
  23. $ok = mysql_query($insert);
  24.  
  25. if ($ok != 0) {
  26.  
  27. $test = "SELECT * FROM Benutzerdaten WHERE Username = '$nick'";
  28. $result = mysql_query($test);
  29. $row = mysql_fetch_array($result, MYSQL_ASSOC);
  30. $nowtheid = $row['ID'];
  31.  
  32. $befehl = mysql_query("SELECT * FROM Benutzerdaten WHERE Username ='$nick'");
  33. if (mysql_num_rows($befehl) > 0)
  34. {
  35. echo "Username vergeben";
  36. } else {
  37.  
  38.  
  39. $banner = "INSERT INTO Bannerklicks(ID) VALUES ('$nowtheid')";
  40. $input = mysql_query($banner);
  41.  
  42. if($input != 0) {
  43.  
  44. session_start();
  45. $_SESSION['ID'] = $nowtheid;
  46.  
  47. header("Location: homeseite.php");
  48. } else {
  49. header("Location: anmeldungsseite.php?error2=true");
  50. }
  51.  
  52. mysql_close($link);
  53. }
  54. }
  55. }
  56. }
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement