Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- session_start();
- // HTML DESIGN
- echo '<!DOCTYPE html>
- <html >
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
- <link rel="shortcut icon" href="assets/images/icon.png" type="image/x-icon">
- <meta name="description" content="">
- <link rel="stylesheet" href="assets/web/assets/mobirise-icons/mobirise-icons.css">
- <link rel="stylesheet" href="assets/tether/tether.min.css">
- <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
- <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css">
- <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-reboot.min.css">
- <link rel="stylesheet" href="assets/theme/css/style.css">
- <link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
- </head>
- <body>
- <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
- <section class="header13 cid-r0UpWN5Ybq mbr-fullscreen mbr-parallax-background" id="header13-3">
- <div class="container">
- </section></div>';
- // CHECK DB CONNECTION
- $sql = new mysqli("localhost", "BCTFUSER", 'w~1=fh(,G+!Q', "BCTFDB");
- if(mysqli_connect_errno()){
- exit("Error in connection !");
- }
- // GET POST VALUES
- $username = mysqli_real_escape_string($sql, $_POST['username']);
- $password = mysqli_real_escape_string($sql, $_POST['password']);
- $email = mysqli_real_escape_string($sql, $_POST['email']);
- // CHECK EMAIL
- $RGX = "/[a-zA-Z0-9_\-.+]+$@[a-zA-Z0-9-]+$.[a-zA-Z]+$/";
- if (preg_match($RGX, $email) == false) {
- echo "<script type='text/javascript'>
- swal('Error!','Do you know how to write your email ?', 'warning')
- .then((value) => {
- location.href='index.php';
- });
- </script>";
- }
- // CHECK SQL
- $qe = $sql->query("SELECT * FROM users WHERE uname='$username' and upassword='password'");
- if($qe->num_rows){
- $_SESSION['US3RN4M3']= $username & "BCTFSESSION" & $password ;
- echo "<script language='javascript' type='text/javascript'> location.href='index.php' </script>";
- } else {
- echo "<script type='text/javascript'>
- swal('Please check your username and password')
- .then((value) => {
- location.href='index.php';
- });
- </script>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement