Advertisement
Guest User

Untitled

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