Advertisement
Guest User

Untitled

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