Advertisement
Guest User

Untitled

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