Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo '<script> swal("Fill out all the fields!", "To be able to login, you need fill out all the fields to we check your account informations.", "error"); </script>';
- if(!isset($_SESSION)) {
- session_start();
- }
- require("includes/config.php");
- if(!empty($_SESSION['username']) || !empty($password)) {
- echo '<script> window.location = "./index.php"; </script>';
- }
- function _SQLi($b) {
- $sqli_letters = array("=", "'", '"');
- return str_replace(array("=", "'", '"'), "", $b);
- }
- function _XSS($b) {
- $sqli_letters = array("<", ">", 'src', '"', "script");
- return str_replace($sqli_letters, "", $b);
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="shortcut icon" href="img/ico/favicon.png">
- <title>REGISTRATION NicoBots</title>
- <!-- Base Styles -->
- <link href="css/style.css" rel="stylesheet">
- <link href="css/style-responsive.css" rel="stylesheet">
- <link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" type="text/css" />
- <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="js/html5shiv.min.js"></script>
- <script src="js/respond.min.js"></script>
- <![endif]-->
- </head>
- <body class="login-body" style="background:#fcfcfc">
- <div class="login-logo">
- <i class="fa fa-maxcdn"></i>
- <div> NicoBots </div> </br></br>
- </div>
- <h2 class="form-heading">REGISTRATION NOW</h2>
- <div class="container log-row">
- <form class="form-signin" method="post">
- <p>Enter your personal details below</p>
- <input type="text" name="login" class="form-control" placeholder="User Name" autofocus>
- <input type="text" name="email" class="form-control" placeholder="Email" autofocus>
- <input type="password" name="password" class="form-control" placeholder="Password">
- <input type="password" name="password1" class="form-control" placeholder="Re-type Password">
- <label class="checkbox-custom check-success">
- <input type="checkbox" value="agree this condition" id="checkbox1"> <label for="checkbox1">I agree to the Terms of Service and Privacy Policy</label>
- </label>
- <button class="btn btn-lg btn-success btn-block" name="register" type="submit">Submit</button>
- <div class="registration m-t-20 m-b-20">
- Already Registered.
- <a class="" href="login.php">
- Login
- </a>
- </div>
- </form>
- </div>
- <?php
- if (isset($_POST['register'])){
- if(isset($_POST['password']) && isset($_POST['email']) && isset($_POST['login']) )
- {
- if($_POST['password']!=$_POST['password1'])
- {
- echo '<script> swal("Password does not match!", "please re-enter the password", "error"); </script>';
- exit();
- }
- $username = $_POST['login'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $query = ("SELECT id FROM users WHERE username='$username'");
- $sql = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($sql) > 0) {
- echo "<script> swal('$username username has already been used!', 'Enter another username', 'error'); </script>";
- }
- else {
- $query2 = ("SELECT id FROM users WHERE email='$email'");
- $sql = mysql_query($query2) or die(mysql_error());
- if (mysql_num_rows($sql) > 0){
- echo '<script> swal("This email has already been used!", "Enter another email", "error"); </script>';
- }
- else{
- $query = "INSERT INTO users (username, password, email, ip, coins, botAmount, time_left, purchases, rank, banned)
- VALUES ('$username', '$password', '$email', '0.0.0.0', '0', '0', '0', '0', '0', 'false')";
- $result = mysql_query($query) or die(mysql_error());;
- echo '<script> swal("Thank you for signing up, '.$username.'", "", "success"); setTimeout(() => {
- window.location = "./login.php";
- }, 2000); </script>';
- }
- }
- }
- else
- echo '<script> swal("Fill out all the fields!", "", "error"); </script>';
- }
- ?>
- <script>
- var resizefunc = [];
- </script>
- <!--jquery-1.10.2.min-->
- <script src="js/jquery-1.11.1.min.js"></script>
- <!--Bootstrap Js-->
- <script src="js/bootstrap.min.js"></script>
- <script src="js/jrespond..min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement