Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. <?php
  2. 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>';
  3.  
  4. if(!isset($_SESSION)) {
  5. session_start();
  6. }
  7.  
  8.  
  9. require("includes/config.php");
  10.  
  11. if(!empty($_SESSION['username']) || !empty($password)) {
  12. echo '<script> window.location = "./index.php"; </script>';
  13. }
  14.  
  15. function _SQLi($b) {
  16. $sqli_letters = array("=", "'", '"');
  17. return str_replace(array("=", "'", '"'), "", $b);
  18. }
  19.  
  20. function _XSS($b) {
  21. $sqli_letters = array("<", ">", 'src', '"', "script");
  22.  
  23. return str_replace($sqli_letters, "", $b);
  24. }
  25.  
  26. ?>
  27.  
  28. <!DOCTYPE html>
  29. <html lang="en">
  30. <head>
  31. <meta charset="utf-8">
  32. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  33. <link rel="shortcut icon" href="img/ico/favicon.png">
  34. <title>REGISTRATION NicoBots</title>
  35.  
  36. <!-- Base Styles -->
  37. <link href="css/style.css" rel="stylesheet">
  38. <link href="css/style-responsive.css" rel="stylesheet">
  39. <link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" type="text/css" />
  40. <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 -->
  41. <!--[if lt IE 9]>
  42. <script src="js/html5shiv.min.js"></script>
  43. <script src="js/respond.min.js"></script>
  44. <![endif]-->
  45.  
  46.  
  47. </head>
  48.  
  49. <body class="login-body" style="background:#fcfcfc">
  50.  
  51. <div class="login-logo">
  52. <i class="fa fa-maxcdn"></i>
  53. <div> NicoBots </div> </br></br>
  54. </div>
  55.  
  56. <h2 class="form-heading">REGISTRATION NOW</h2>
  57.  
  58. <div class="container log-row">
  59. <form class="form-signin" method="post">
  60. <p>Enter your personal details below</p>
  61. <input type="text" name="login" class="form-control" placeholder="User Name" autofocus>
  62. <input type="text" name="email" class="form-control" placeholder="Email" autofocus>
  63. <input type="password" name="password" class="form-control" placeholder="Password">
  64. <input type="password" name="password1" class="form-control" placeholder="Re-type Password">
  65. <label class="checkbox-custom check-success">
  66. <input type="checkbox" value="agree this condition" id="checkbox1"> <label for="checkbox1">I agree to the Terms of Service and Privacy Policy</label>
  67. </label>
  68.  
  69.  
  70. <button class="btn btn-lg btn-success btn-block" name="register" type="submit">Submit</button>
  71.  
  72. <div class="registration m-t-20 m-b-20">
  73. Already Registered.
  74. <a class="" href="login.php">
  75. Login
  76. </a>
  77. </div>
  78. </form>
  79. </div>
  80.  
  81. <?php
  82.  
  83. if (isset($_POST['register'])){
  84.  
  85. if(isset($_POST['password']) && isset($_POST['email']) && isset($_POST['login']) )
  86. {
  87. if($_POST['password']!=$_POST['password1'])
  88. {
  89. echo '<script> swal("Password does not match!", "please re-enter the password", "error"); </script>';
  90. exit();
  91. }
  92. $username = $_POST['login'];
  93.  
  94.  
  95. $password = $_POST['password'];
  96. $email = $_POST['email'];
  97. $query = ("SELECT id FROM users WHERE username='$username'");
  98.  
  99.  
  100. $sql = mysql_query($query) or die(mysql_error());
  101.  
  102. if (mysql_num_rows($sql) > 0) {
  103. echo "<script> swal('$username username has already been used!', 'Enter another username', 'error'); </script>";
  104. }
  105. else {
  106. $query2 = ("SELECT id FROM users WHERE email='$email'");
  107. $sql = mysql_query($query2) or die(mysql_error());
  108. if (mysql_num_rows($sql) > 0){
  109. echo '<script> swal("This email has already been used!", "Enter another email", "error"); </script>';
  110. }
  111. else{
  112. $query = "INSERT INTO users (username, password, email, ip, coins, botAmount, time_left, purchases, rank, banned)
  113. VALUES ('$username', '$password', '$email', '0.0.0.0', '0', '0', '0', '0', '0', 'false')";
  114. $result = mysql_query($query) or die(mysql_error());;
  115. echo '<script> swal("Thank you for signing up, '.$username.'", "", "success"); setTimeout(() => {
  116. window.location = "./login.php";
  117. }, 2000); </script>';
  118.  
  119. }
  120.  
  121. }
  122. }
  123. else
  124. echo '<script> swal("Fill out all the fields!", "", "error"); </script>';
  125.  
  126. }
  127.  
  128.  
  129. ?>
  130.  
  131.  
  132.  
  133. <script>
  134. var resizefunc = [];
  135. </script>
  136.  
  137. <!--jquery-1.10.2.min-->
  138. <script src="js/jquery-1.11.1.min.js"></script>
  139. <!--Bootstrap Js-->
  140. <script src="js/bootstrap.min.js"></script>
  141. <script src="js/jrespond..min.js"></script>
  142.  
  143.  
  144. </body>
  145. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement