Guest User

Untitled

a guest
Feb 24th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.89 KB | None | 0 0
  1. <!--
  2.  
  3.   8     w      w                        
  4.   8d8b. w 88b. w d88b   88b. Yb  db  dP
  5.   8P Y8 8 8  8 8 `Yb.   8  8  YbdPYbdP  
  6.   8   8 8 88P' 8 Y88P w 88P'   YP  YP  
  7.           8             8              
  8.  
  9. -->
  10.  
  11. <!-- database script -->
  12. <?php
  13.   require_once "../../assets/script_database.php";
  14.   $username = $password = $confirm_password = "";
  15.   $info_err = "register is disabled atm";
  16.   if($_SERVER["REQUEST_METHOD"] == "POST"){
  17.   if(empty(trim($_POST["invite_code"]))){
  18.   $info_err = "please enter a invite code";
  19.   } else {
  20.   $codeinput = trim($_POST["invite_code"]);  
  21.   $sql = "SELECT code FROM codes WHERE code = $codeinput";
  22.   if(mysql_num_rows($sql) == 0){
  23.   $info_err = "No valid code";
  24.   } else {
  25.   $invitecodefinal = $codeinput;
  26.   }
  27.   } else {
  28.   $info_err = "something went wrong, try again";
  29.   }
  30.   mysqli_stmt_close($stmt);
  31.   }  
  32.      
  33.      
  34.   if(empty(trim($_POST["username"]))){
  35.   $info_err = "please enter a username";
  36.   } else {
  37.   $sql = "SELECT ID FROM users WHERE username = ?";
  38.   if($stmt = mysqli_prepare($link, $sql)){
  39.   mysqli_stmt_bind_param($stmt, "s", $param_username);
  40.   $param_username = trim($_POST["username"]);
  41.   if(mysqli_stmt_execute($stmt)){
  42.   mysqli_stmt_store_result($stmt);
  43.   if(mysqli_stmt_num_rows($stmt) == 1){
  44.   $info_err = "this username is already taken";
  45.   } else {
  46.   $username = trim($_POST["username"]);
  47.   }
  48.   } else {
  49.   $info_err = "something went wrong, try again";
  50.   }
  51.   }
  52.   mysqli_stmt_close($stmt);
  53.   }
  54.   if(empty(trim($_POST["password"]))){
  55.   $info_err = "please enter a password";    
  56.   } elseif(strlen(trim($_POST["password"])) < 6){
  57.   $info_err = "password must have atleast 6 characters";
  58.   } else {
  59.   $password = trim($_POST["password"]);
  60.   }
  61.   if(empty(trim($_POST["confirm_password"]))){
  62.   $info_err = "please confirm a password";    
  63.   } else {
  64.   $confirm_password = trim($_POST["confirm_password"]);
  65.   if(empty($info_err) && ($password != $confirm_password)){
  66.   $info_err = "passwords did not match";
  67.   }
  68.   }
  69.   if(empty($info_err)){
  70.   $sql = "INSERT INTO users (username, password, code) VALUES (?, ?, $invitecodefinal)";
  71.   if($stmt = mysqli_prepare($link, $sql)){
  72.   mysqli_stmt_bind_param($stmt, "ss", $param_username, $param_password);
  73.   $param_username = $username;
  74.   $param_password = password_hash($password, PASSWORD_DEFAULT);
  75.   if(mysqli_stmt_execute($stmt)){
  76.   header("location: /panel/login/");
  77.   } else {
  78.   $info_err = "something went wrong, try again";
  79.   }
  80.   }
  81.   mysqli_stmt_close($stmt);
  82.   }
  83.   mysqli_close($link);
  84.   }
  85. ?>
  86. <!-- database script -->
  87.  
  88. <!DOCTYPE html>
  89. <html>
  90. <head>
  91. <body onload="checkstatus()">
  92.  
  93. <meta charset="utf-8">
  94.  
  95. <title>HIPIS.PW – PANEL</title>
  96. <link rel="icon" type="image/png" href="/assets/favicon.png"/>
  97.  
  98. <link rel="stylesheet" type="text/css" href="/assets/style.css">
  99. <script src="/assets/script.js"></script>
  100.  
  101. <!-- background video -->
  102. <div class="background">
  103. <iframe src="/assets/silence.mp3" allow="autoplay" id="audio" style="display:none"></iframe>
  104. <video playsinline autoplay loop id="videobg">
  105. <source src="/assets/video.mp4" type="video/mp4">
  106. <script>
  107.   var video = document.currentScript.parentElement;
  108.   video.volume = 0.05;
  109. </script>
  110. </video>
  111. </div>
  112. <!-- background video -->
  113.  
  114. <!-- up section -->
  115. <usection>
  116. <center>
  117. <div style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; -o-user-select: none" unselectable="on" onselectstart="return false" onmousedown="return false">
  118.   <p>site updated <b>24/02/2019</b></p>
  119.   <p>current time <b><span id="time"></span></b></p>
  120.   <p>site status <b><span id="status"></span></b></p>
  121. </div>
  122. </center>
  123. </usection>
  124. <!-- up section -->
  125.  
  126. <!-- main section -->
  127. <section>
  128. <center>
  129. <div style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; -o-user-select: none" unselectable="on" onselectstart="return false" onmousedown="return false">
  130.   <p><b><font color="ccccff">HIPIS</font>.PW</b></p>
  131.   <br>
  132.   <font size="4">
  133.   <p><a href="/panel/">← home</a>
  134.   <font color="4c4c4c"><b>/</b></font>
  135.   <a href="/panel/login/">login</a></p>
  136.   <br>
  137.   <p><font color=be3737><?php echo $info_err; ?></font></p>
  138.   </div>
  139.   <form action="/panel/register/" method="post">
  140.   <input type="text" name="username" placeholder="username" style="text-align:center;" disabled>
  141.   <input type="password" name="password" placeholder="password" style="text-align:center;" disabled>
  142.   <input type="password" name="confirm_password" placeholder="confirm password" style="text-align:center;" disabled>
  143.   <input type="text" name="invite_code" placeholder="invite code" style="text-align:center;" disabled>
  144.   <input type="submit" value="register" disabled>
  145.   </form>
  146.   </font>
  147. </center>
  148. </section>
  149. <!-- main section -->
  150.  
  151. </body>
  152. </head>
  153. </html>
  154.  
  155. <!-- check site status script -->
  156. <script>
  157.   function checkstatus() {
  158.   var currentLocation = window.location.href;
  159.   if (currentLocation == "https://hipis.pw/panel/register/") {
  160.   document.getElementById('status').innerHTML += "<font color=008000>official</font>";
  161.   }  
  162.   else {
  163.   document.getElementById('status').innerHTML += "<font color=be3737>unofficial, current site differs from official site hipis.pw</font>";
  164.   }
  165.   }
  166. </script>
  167. <!-- check site status script -->
  168.  
  169. <!-- current time script -->
  170. <script>
  171.   function clock() {
  172.   var d = new Date();
  173.   var hours = d.getHours();
  174.   var minutes = d.getMinutes();
  175.   var seconds = d.getSeconds();
  176.   if (hours <= 9) hours = "0" + hours;
  177.   if (minutes <= 9) minutes = "0" + minutes;
  178.   if (seconds <= 9) seconds = "0" + seconds;
  179.   date_time = hours + ":" + minutes + ":" + seconds;
  180.   if (document.layers) {
  181.   document.layers.time.document.write(date_time);
  182.   document.layers.time.document.close();
  183.   }
  184.   else document.getElementById("time").innerHTML = date_time;
  185.   setTimeout("clock()", 1000);
  186.   }
  187.   clock();
  188. </script>
  189. <!-- current time script -->
Add Comment
Please, Sign In to add comment