Advertisement
Guest User

Untitled

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