Advertisement
Guest User

Untitled

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