Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.28 KB | None | 0 0
  1. <?
  2. session_start();
  3.  
  4. // HTML DESIGN
  5. echo '<!DOCTYPE html>
  6. <html >
  7. <head>
  8.  <meta charset="UTF-8">
  9.  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  10.  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
  11.  <link rel="shortcut icon" href="assets/images/icon.png" type="image/x-icon">
  12.  <meta name="description" content="">
  13.  <link rel="stylesheet" href="assets/web/assets/mobirise-icons/mobirise-icons.css">
  14.  <link rel="stylesheet" href="assets/tether/tether.min.css">
  15.  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  16.  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css">
  17.  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-reboot.min.css">
  18.  <link rel="stylesheet" href="assets/theme/css/style.css">
  19.  <link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
  20. </head>
  21. <body>
  22. <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  23.  <section class="header13 cid-r0UpWN5Ybq mbr-fullscreen mbr-parallax-background" id="header13-3">
  24.    <div class="container">
  25. </section></div>';
  26.            
  27.  // CHECK DB CONNECTION
  28.  
  29. $sql = new mysqli("localhost", "BCTFUSER", 'w~1=fh(,G+!Q', "BCTFDB");
  30.  
  31. if(mysqli_connect_errno()){
  32.  
  33. exit("Error in connection !");
  34.  
  35. }
  36.  
  37.  // GET POST VALUES
  38.  
  39. $username = mysqli_real_escape_string($sql, $_POST['username']);
  40.  
  41. $password = mysqli_real_escape_string($sql, $_POST['password']);
  42.  
  43. $email = mysqli_real_escape_string($sql, $_POST['email']);
  44.  
  45.  // CHECK EMAIL
  46.  
  47. $RGX = "/[a-zA-Z0-9_\-.+]+$@[a-zA-Z0-9-]+$.[a-zA-Z]+$/";
  48.  
  49. if (preg_match($RGX, $email) == false) {
  50.   echo "<script type='text/javascript'>
  51. swal('Error!','Do you know how to write your email ?', 'warning')
  52. .then((value) => {
  53.     location.href='index.php';
  54. });
  55. </script>";
  56. }
  57.  
  58.  // CHECK SQL
  59.  
  60. $qe = $sql->query("SELECT * FROM users WHERE uname='$username' and upassword='password'");
  61.  
  62. if($qe->num_rows){
  63.  
  64. $_SESSION['US3RN4M3']= $username & "BCTFSESSION" & $password ;
  65. echo "<script language='javascript' type='text/javascript'> location.href='index.php' </script>";  
  66.  
  67. } else {
  68.  
  69.     echo "<script type='text/javascript'>
  70. swal('Please check your username and password')
  71. .then((value) => {
  72.     location.href='index.php';
  73. });
  74. </script>";
  75.  
  76. }
  77.  
  78. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement