Advertisement
Guest User

Untitled

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