Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 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. mysql_query("DELETE FROM codes WHERE code=$invitecode");
  76. $sql = "INSERT INTO users (username, password, code) VALUES (?, ?, ?)";
  77. if($stmt = mysqli_prepare($link, $sql)){
  78. mysqli_stmt_bind_param($stmt, "sss", $param_username, $param_password, $param_code);
  79. $param_username = $username;
  80. $param_password = password_hash($password, PASSWORD_DEFAULT);
  81. $param_code = $invitecode;
  82. if(mysqli_stmt_execute($stmt)){
  83. header("location: /panel/login/");
  84. } else {
  85. $info_err = "something went wrong, try again";
  86. }
  87. }
  88. mysqli_stmt_close($stmt);
  89. }
  90. mysqli_close($link);
  91. }
  92. ?>
  93. <!-- database script -->
  94.  
  95. <!DOCTYPE html>
  96. <html>
  97. <head>
  98. <body onload="checkstatus()">
  99.  
  100. <meta charset="utf-8">
  101.  
  102. <title>HIPIS.PW – PANEL</title>
  103. <link rel="icon" type="image/png" href="/assets/favicon.png"/>
  104.  
  105. <link rel="stylesheet" type="text/css" href="/assets/style.css">
  106. <script src="/assets/script.js"></script>
  107.  
  108. <!-- background video -->
  109. <div class="background">
  110. <iframe src="/assets/silence.mp3" allow="autoplay" id="audio" style="display:none"></iframe>
  111. <video playsinline autoplay loop id="videobg">
  112. <source src="/assets/video.mp4" type="video/mp4">
  113. <script>
  114. var video = document.currentScript.parentElement;
  115. video.volume = 0.05;
  116. </script>
  117. </video>
  118. </div>
  119. <!-- background video -->
  120.  
  121. <!-- up section -->
  122. <usection>
  123. <center>
  124. <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">
  125. <p>site updated <b>24/02/2019</b></p>
  126. <p>current time <b><span id="time"></span></b></p>
  127. <p>site status <b><span id="status"></span></b></p>
  128. </div>
  129. </center>
  130. </usection>
  131. <!-- up section -->
  132.  
  133. <!-- main section -->
  134. <section>
  135. <center>
  136. <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">
  137. <p><b><font color="ccccff">HIPIS</font>.PW</b></p>
  138. <br>
  139. <font size="4">
  140. <p><a href="/panel/">← home</a>
  141. <font color="4c4c4c"><b>/</b></font>
  142. <a href="/panel/login/">login</a></p>
  143. <br>
  144. <p><font color=be3737><?php echo $info_err; ?></font></p>
  145. </div>
  146. <form action="/panel/register/" method="post">
  147. <input type="text" name="username" placeholder="username" style="text-align:center;" disabled>
  148. <input type="password" name="password" placeholder="password" style="text-align:center;" disabled>
  149. <input type="password" name="confirm_password" placeholder="confirm password" style="text-align:center;" disabled>
  150. <input type="text" name="invite_code" placeholder="invite code" style="text-align:center;" disabled>
  151. <input type="submit" value="register" disabled>
  152. </form>
  153. </font>
  154. </center>
  155. </section>
  156. <!-- main section -->
  157.  
  158. </body>
  159. </head>
  160. </html>
  161.  
  162. <!-- check site status script -->
  163. <script>
  164. function checkstatus() {
  165. var currentLocation = window.location.href;
  166. if (currentLocation == "https://hipis.pw/panel/register/") {
  167. document.getElementById('status').innerHTML += "<font color=008000>official</font>";
  168. }
  169. else {
  170. document.getElementById('status').innerHTML += "<font color=be3737>unofficial, current site differs from official site hipis.pw</font>";
  171. }
  172. }
  173. </script>
  174. <!-- check site status script -->
  175.  
  176. <!-- current time script -->
  177. <script>
  178. function clock() {
  179. var d = new Date();
  180. var hours = d.getHours();
  181. var minutes = d.getMinutes();
  182. var seconds = d.getSeconds();
  183. if (hours <= 9) hours = "0" + hours;
  184. if (minutes <= 9) minutes = "0" + minutes;
  185. if (seconds <= 9) seconds = "0" + seconds;
  186. date_time = hours + ":" + minutes + ":" + seconds;
  187. if (document.layers) {
  188. document.layers.time.document.write(date_time);
  189. document.layers.time.document.close();
  190. }
  191. else document.getElementById("time").innerHTML = date_time;
  192. setTimeout("clock()", 1000);
  193. }
  194. clock();
  195. </script>
  196. <!-- current time script -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement