Advertisement
Guest User

Untitled

a guest
May 10th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.60 KB | None | 0 0
  1. <!--
  2.  * @author Maze
  3.  * @files Spheron
  4.  * @type Registration
  5.  * @copyright 2009
  6.  -->
  7.  
  8. <head>
  9. <title>..:: Spheron -> Register ::..</title>
  10. </head>
  11. <div align="center">
  12. <form action="register.php" method="post">
  13. <table border = "1"><tr>
  14. <td>Benutzername*</td><td><input type="text" name="user" lenght="16" /></td></tr>
  15. <tr><td>Passwort*</td><td><input type="password" name="pass" lenght="16" /></td></tr>
  16. <tr><td>Repeat Passwort*</td><td><input type ="password" name="pass2" lenght="16" /></td></tr>
  17. <tr><td>GM Passwort</td><td><input type ="password" name="gmpass"/></td></tr>
  18. <tr><td><b>*muss ausgef&uuml;llt werden</b></td></tr>
  19. <tr><td><input type="submit" value="Register" /></td><td><input type="reset" value="Reset"></td></tr>
  20. </form>
  21. </div>
  22. </html>
  23.  
  24.  
  25. <!--____________________Dont Change Below except you know what you do_______________________-->
  26.  
  27.  
  28. <?php
  29.  
  30. /*
  31.  * @author Maze
  32.  * @files Spheron
  33.  * @type Registration
  34.  * @copyright 2009
  35.  */
  36. require('config.php');
  37.  
  38. if ($_POST['submit'] != '0')
  39.    {
  40.     if(!$_POST['user'] ||
  41.         !$_POST['pass'] ||
  42.         !$_POST['pass2'])
  43.         {
  44.         die('<b><center>Du musst alle Felder ausfüllen !</center></b>');
  45.         }
  46.     else {
  47.         $user = htmlspecialchars(
  48.                      trim(
  49.                           mysql_real_escape_string($_POST['user'])
  50.                           )
  51.                     );
  52.         $pass = md5(
  53.                 $customsalt.$_POST['pass']
  54.                 );
  55.         $pass2 = md5(
  56.                 $customsalt.$_POST['pass2']
  57.                  );
  58.         if (strlen($user) <4 ||
  59.             strlen($user) >16)
  60.             {
  61.             die("<b>Dein Benutzername ist zu kurz/lang .</b>");
  62.             }
  63.         if (strlen($_POST['pass']) <4 ||
  64.             strlen($_POST['pass']) >16)
  65.             {
  66.             die("<b>Dein Passwort ist zu kurz/lang .</b>");
  67.             }
  68.         $gmpass = htmlspecialchars(
  69.                        trim($_POST['gmpass'])
  70.                        );
  71.         if (exist($user) != '0')
  72.             {
  73.             die ("<b>Der Benutzername ".$_POST['user']."wird schon benutzt</b>");
  74.                 }
  75.         else {
  76.               if($pass != $pass2)
  77.              {
  78.               die ("<b>Die Passwörter stimmen nicht überrein !</b>");
  79.               }
  80.               else{
  81.                if ($gmpass != $gmpassword)
  82.                      {
  83.                      $accountal = $accesslevel;
  84.                      }
  85.                   else {
  86.                        echo '<b>GM Passwort ist richtig<br>Ein GM Account wird erstellt.</b>';
  87.                                $accountal = $gmaccesslevel;
  88.                        }
  89.                   }
  90.              if (mysql_query("INSERT INTO accounts (name,password,accesslevel) VALUES ('$user','$pass','$accountal')"))
  91.             {
  92.             echo '<b>Dein Account wurde erstellt !</b>';
  93.             }
  94.              else
  95.                     {
  96.                          echo '<b>Datenbankfehler</b>';
  97.                  }
  98.                   }
  99.            }
  100.    }
  101. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement