Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- 8 w w
- 8d8b. w 88b. w d88b 88b. Yb db dP
- 8P Y8 8 8 8 8 `Yb. 8 8 YbdPYbdP
- 8 8 8 88P' 8 Y88P w 88P' YP YP
- 8 8
- -->
- <!-- database script -->
- <?php
- require_once "../../assets/script_database.php";
- $username = $password = $confirm_password = "";
- $info_err = "register is disabled atm";
- if($_SERVER["REQUEST_METHOD"] == "POST"){
- if(empty(trim($_POST["invite_code"]))){
- $info_err = "please enter a invite code";
- } else {
- $codeinput = trim($_POST["invite_code"]);
- $sql = "SELECT code FROM codes WHERE code = $codeinput";
- if(mysql_num_rows($sql) == 0){
- $info_err = "No valid code";
- } else {
- $invitecodefinal = $codeinput;
- }
- mysqli_stmt_close($stmt);
- }
- if(empty(trim($_POST["username"]))){
- $info_err = "please enter a username";
- } else {
- $sql = "SELECT ID FROM users WHERE username = ?";
- if($stmt = mysqli_prepare($link, $sql)){
- mysqli_stmt_bind_param($stmt, "s", $param_username);
- $param_username = trim($_POST["username"]);
- if(mysqli_stmt_execute($stmt)){
- mysqli_stmt_store_result($stmt);
- if(mysqli_stmt_num_rows($stmt) == 1){
- $info_err = "this username is already taken";
- } else {
- $username = trim($_POST["username"]);
- }
- } else {
- $info_err = "something went wrong, try again";
- }
- }
- mysqli_stmt_close($stmt);
- }
- if(empty(trim($_POST["password"]))){
- $info_err = "please enter a password";
- } elseif(strlen(trim($_POST["password"])) < 6){
- $info_err = "password must have atleast 6 characters";
- } else {
- $password = trim($_POST["password"]);
- }
- if(empty(trim($_POST["confirm_password"]))){
- $info_err = "please confirm a password";
- } else {
- $confirm_password = trim($_POST["confirm_password"]);
- if(empty($info_err) && ($password != $confirm_password)){
- $info_err = "passwords did not match";
- }
- }
- if(empty($info_err)){
- $sql = "INSERT INTO users (username, password, code) VALUES (?, ?, $invitecodefinal)";
- if($stmt = mysqli_prepare($link, $sql)){
- mysqli_stmt_bind_param($stmt, "ss", $param_username, $param_password);
- $param_username = $username;
- $param_password = password_hash($password, PASSWORD_DEFAULT);
- if(mysqli_stmt_execute($stmt)){
- header("location: /panel/login/");
- } else {
- $info_err = "something went wrong, try again";
- }
- }
- mysqli_stmt_close($stmt);
- }
- mysqli_close($link);
- }
- ?>
- <!-- database script -->
- <!DOCTYPE html>
- <html>
- <head>
- <body onload="checkstatus()">
- <meta charset="utf-8">
- <title>HIPIS.PW – PANEL</title>
- <link rel="icon" type="image/png" href="/assets/favicon.png"/>
- <link rel="stylesheet" type="text/css" href="/assets/style.css">
- <script src="/assets/script.js"></script>
- <!-- background video -->
- <div class="background">
- <iframe src="/assets/silence.mp3" allow="autoplay" id="audio" style="display:none"></iframe>
- <video playsinline autoplay loop id="videobg">
- <source src="/assets/video.mp4" type="video/mp4">
- <script>
- var video = document.currentScript.parentElement;
- video.volume = 0.05;
- </script>
- </video>
- </div>
- <!-- background video -->
- <!-- up section -->
- <usection>
- <center>
- <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">
- <p>site updated <b>24/02/2019</b></p>
- <p>current time <b><span id="time"></span></b></p>
- <p>site status <b><span id="status"></span></b></p>
- </div>
- </center>
- </usection>
- <!-- up section -->
- <!-- main section -->
- <section>
- <center>
- <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">
- <p><b><font color="ccccff">HIPIS</font>.PW</b></p>
- <br>
- <font size="4">
- <p><a href="/panel/">← home</a>
- <font color="4c4c4c"><b>/</b></font>
- <a href="/panel/login/">login</a></p>
- <br>
- <p><font color=be3737><?php echo $info_err; ?></font></p>
- </div>
- <form action="/panel/register/" method="post">
- <input type="text" name="username" placeholder="username" style="text-align:center;" disabled>
- <input type="password" name="password" placeholder="password" style="text-align:center;" disabled>
- <input type="password" name="confirm_password" placeholder="confirm password" style="text-align:center;" disabled>
- <input type="text" name="invite_code" placeholder="invite code" style="text-align:center;" disabled>
- <input type="submit" value="register" disabled>
- </form>
- </font>
- </center>
- </section>
- <!-- main section -->
- </body>
- </head>
- </html>
- <!-- check site status script -->
- <script>
- function checkstatus() {
- var currentLocation = window.location.href;
- if (currentLocation == "https://hipis.pw/panel/register/") {
- document.getElementById('status').innerHTML += "<font color=008000>official</font>";
- }
- else {
- document.getElementById('status').innerHTML += "<font color=be3737>unofficial, current site differs from official site hipis.pw</font>";
- }
- }
- </script>
- <!-- check site status script -->
- <!-- current time script -->
- <script>
- function clock() {
- var d = new Date();
- var hours = d.getHours();
- var minutes = d.getMinutes();
- var seconds = d.getSeconds();
- if (hours <= 9) hours = "0" + hours;
- if (minutes <= 9) minutes = "0" + minutes;
- if (seconds <= 9) seconds = "0" + seconds;
- date_time = hours + ":" + minutes + ":" + seconds;
- if (document.layers) {
- document.layers.time.document.write(date_time);
- document.layers.time.document.close();
- }
- else document.getElementById("time").innerHTML = date_time;
- setTimeout("clock()", 1000);
- }
- clock();
- </script>
- <!-- current time script -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement