Sahitya-K

sign up

Apr 1st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.20 KB | None | 0 0
  1. <?php  error_reporting(E_ALL); ini_set('display_errors', TRUE);  ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.     <title>RUS GOLD Sign Up</title>
  6.       <link rel="icon" href="favicon.ico">
  7.       <style>
  8. .logo {float: left;} .nav {float: right; margin: 30px; margin-right: 45px;}
  9. .nav a { font-size: 25px;text-decoration:none;color: #000; font-family: Lucida Sans Unicode; font-weight: normal;}  .nav a:hover {opacity:.5;}
  10. .sign { width: 50%;} .sign_2 {float:right;width: 50%; margin-top: -227px;}
  11.  h1 {text-align: center; font-family: arial; font-size: 35px; color: #5E0000;}
  12. .sign input { float: right; padding: 15px; border: none;border-bottom: 1px solid #ccc; width: 60%; margin-right: 40px;}
  13. .sign_2 input {float: left; padding: 15px; border: none;border-bottom: 1px solid #ccc; width: 60%; margin-left: 40px;}
  14. button {float: right; margin-right: 200px; background-color: #D4A713; color: #fff; padding: 15px; border: none;font-size: 15px; font-weight: bold;cursor: pointer;}
  15.       </style>
  16. </head>
  17. <body>
  18.   <div class="logo">
  19.   <img style="height: 80px;" src="rus_logo.png">
  20.   <p style="margin-top: -15px; margin-left: 60px; opacity: 0.7;">beta</p>
  21. </div>
  22. <div class="nav"><a href="faucet.php">Claim RUS GOLD</a></div><br><br><br><br><br>
  23. <h1>Create An Account</h1><br><br><br>
  24. <form method="POST">
  25.     <div class="sign">
  26.       <input type="text" name="username" placeholder="Enter Username..." ><br><br><br><br><br>
  27.           <input type="email" name="email" placeholder="Enter E-Mail..." ><br><br><br><br><br>
  28.           <input type="text" name="ref" value="<?php $user = $_GET['ref']; if ( isset($_GET['ref']) && $_GET['ref'] == $user ){ echo $user;} ?>" placeholder="Refferal Name..." readonly><br><br>
  29.         </div>
  30.         <div class="sign_2">
  31.               <input type="password" name="pass" placeholder="Enter Password..." ><br><br><br><br><br>
  32.   <input type="password" name="confpass" placeholder="Confirm Password..." ><br><br><br><br><br>
  33.   <?php
  34. if (isset($_POST['submit'])) {
  35.  
  36. include 'conn.php';
  37.     $username = mysqli_real_escape_string($conn, $_POST['username']);
  38.     $email = mysqli_real_escape_string($conn, $_POST['email']);
  39.     $password = mysqli_real_escape_string($conn, $_POST['pass']);
  40.     $confpassword = mysqli_real_escape_string($conn, $_POST['confpass']);
  41.     if(isset($_POST['ref'])){
  42.     $filename = mysqli_real_escape_string($conn, $_POST['ref']);
  43.      }
  44.  
  45.     if (empty($username) || empty($email) || empty($password) || empty($confpassword) ) {
  46.         echo "<script>alert('Invalid Inputs');</script>";
  47.     }
  48.      else if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  49.         echo "<script>alert('Invalid E-Mail');</script>";
  50.      }
  51.      else if ($password !== $confpassword) {
  52.         echo "<script>alert('Your Password does not match with each other');</script>";
  53.      }
  54.        else {
  55.         $sql = "SELECT * FROM login WHERE email = '$email'";
  56.         $result = mysqli_query($conn, $sql);
  57.         $res = mysqli_num_rows($result);
  58.          
  59.          if ($res > 0) {
  60.             echo "<script>alert('E-Mail Already Exists');</script>";
  61.          } else {
  62.              $hashedpw = password_hash($password, PASSWORD_DEFAULT);
  63.               $selector = bin2hex(random_bytes(8));
  64.                $token = random_bytes(32);
  65.                 $tok = bin2hex($token);
  66.                 $expires = date("U") + 604800;
  67.                  $sql = "INSERT INTO login (username,email,password,ref,poi,refval,selector,validator,val) VALUES ('$username', '$email', '$hashedpw', '$filename','100','$expires', '$selector','$tok','0');";
  68.                      if ($conn->query($sql) === TRUE) {
  69.                  $url = "http://inforus.xyz/val.php?selector=". $selector . "&validator=". $tok;
  70.                    include 'testk.php';
  71.                      echo "<script> alert('Please Confirm your Email.');</script>";
  72.                 $snh = "INSERT INTO exp (username,expires) VALUES ('$username', '155399945');";
  73.                 mysqli_query($conn, $snh);
  74.                      } else {
  75.                         echo "<script>alert('SQL Error Please inform us about the Error so we can solve this as soon as possible');</script>";
  76.                      }
  77.                          
  78.    
  79.          }
  80.  
  81.           }
  82.          
  83.        }
  84.  
  85. ?>
  86.   <button type="submit" name="submit">Sign Up</button>
  87.         </div>
  88.        
  89. </form>
  90.  
  91. </body>
  92. </html>
Add Comment
Please, Sign In to add comment