Advertisement
karlokokkak

Untitled

Apr 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.66 KB | None | 0 0
  1. <?php
  2.         error_reporting(E_ALL);
  3.         ini_set("display_errors", 1);
  4.        
  5.         session_start();
  6.                    
  7.         $con = mysqli_connect("localhost", "softwebs_softweb", "Demo@123", "softwebs_registration") or die(mysqli_error());
  8.  
  9.  
  10.         if(isset($_POST['submit'])){
  11.             $Mobile = $_POST['Mobile'];
  12.             $Password = $_POST['Password'];
  13.              
  14.             if(empty($Mobile) OR empty($Password)){
  15.            
  16.              
  17.            $message1= "
  18.             <h3>All fields are required for  login.</h3>";
  19.  
  20.             //exit($message1);
  21.             }
  22.  
  23.             //check remeber me button is set or not
  24.             if(isset($_POST['re'])){
  25.                 $re = "on";
  26.             }else{
  27.                 $re = "";
  28.             }
  29.  
  30.             //check username and pass
  31.             $query = mysqli_query($con,"SELECT * FROM `UserRegLogs` WHERE Mobile='$Mobile' AND Password='$Password'");
  32.  
  33.             if(mysqli_num_rows($query) > 0){
  34.                 $_SESSION['Mobile'] = $Mobile;
  35.                 //login the user in
  36.                 if($remember == "active"){ //remember me checked
  37.                     setcookie("Mobile",$Mobile,time() + (86400  * 10));
  38.                 }
  39.                
  40.                 header("Location: index.php");
  41.                 exit();
  42.                
  43.          
  44.              
  45.             //exit($message2);
  46.             }
  47.             else {
  48.              $message2= "
  49.              <h3>Invalid Credentials.</h3>
  50.              ";
  51.              }
  52.         }
  53.     ?>
  54. <!DOCTYPE html>
  55. <html lang="en-US">
  56. <head>
  57. <title>Send Free SMS | SHIVKR</title>
  58. <meta charset="utf-8"/>
  59. <META http-equiv="Content-Type" content="text/html; charset="utf-8">
  60. <META http-equiv="Content-Style-Type" content="text/css">
  61. <META Http-Equiv="Cache-Control" Content="no-cache">
  62. <META Http-Equiv="Pragma" Content="no-cache">
  63. <META Http-Equiv="Expires: Thu, 01 Dec 2018 16:00:00 GMT" Content="0">
  64. <meta name="viewport" content="user-scalable = 0, width=device-width, initial-scale=1.0" />
  65.  
  66. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
  67. <link type="text/css" rel="stylesheet" href="/copyright/assets/css/version-018.12.281.9197-style_v2_optimized.css"/>
  68. <style>body {
  69.   overscroll-behavior-y: contain;
  70. }</style>
  71. </head>
  72. <body>
  73.  
  74. <!--<div class="loader"></div>-->    
  75. <!-- BEGIN: Sticky Header -->
  76.  
  77. <!-- END: Sticky Header -->
  78.  
  79. <!-- START: Page Content -->
  80.  
  81.  
  82. <!-- START: Form -->
  83. <div class="box">
  84.      
  85.       <div class="row">
  86.       <div class="logo-row">
  87.       <img src="https://softweb2sms.thats.im/copyright/assets/images/login-icon.png" title="Send Free SMS | SHIVKR" alt="Send Free SMS | SHIVKR" class="logo"/>
  88.      </div>
  89.      </div>
  90.  
  91.      
  92. <div>
  93. <?php if(isset($message1)) { echo $message1; } ?>
  94. <?php if(isset($message2)) { echo $message2; } ?>
  95. </div>
  96.        
  97.  
  98. <form method="POST" action='<?php echo $_SERVER['PHP_SELF']; ?>' enctype="multipart/form-data">
  99.            
  100.            
  101. <p class="inp-wrap">
  102.  
  103. <div class="ico icobg">
  104. <input type="tel" class="inp clearable" name="Mobile" placeholder="Enter your mobile number." Value="9661697474" maxlength="10" minlength="10" onfocus="disableautocompletion(this.id);getFocus(this.id);"
  105.                             autocomplete="off" onblur="disableautocompletion(this.id);"
  106.                             onCopy="return false" onPaste="return false"
  107.                             onKeyPress="return disableCtrlKeyCombination(event);"
  108.                             onKeyDown="return disableCtrlKeyCombination(event);"  />
  109. <i class="fa fa-user fa-lg fa-fw" aria-hidden="true"></i>
  110. </div>
  111.  
  112. </p>
  113.  
  114. <p class="inp-wrap">
  115. <div class="ico icobg">
  116. <input class="inp clearable" type="password" name="Password"  placeholder="Enter your passcode" minlength="06"  onfocus="disableautocompletion(this.id);getFocus(this.id);"
  117.                             autocomplete="off" onblur="disableautocompletion(this.id);"
  118.                             onCopy="return false" onPaste="return false"
  119.                             onKeyPress="return disableCtrlKeyCombination(event);"
  120.                             onKeyDown="return disableCtrlKeyCombination(event);"  />
  121. <i class="fa fa-lock fa-lg fa-fw" aria-hidden="true"></i>
  122. </div>
  123. </p>
  124.  
  125. <div>
  126.      <label for="re" style="font-weight: normal; font-size:13px;">
  127.         <input id="re"  type="checkbox" value="on" name="re"/>Remember me
  128.      </label>
  129. </div>      
  130.        
  131. <p class="inp-wrap">
  132. <input class="encryptedSend" type="submit" value="Log-in securely" name="submit"/>
  133. </p>
  134.  
  135. </form>
  136.  
  137. </div>    
  138. <!-- END: Form -->  
  139.  
  140.    
  141. <!-- END: Page Content -->
  142.  
  143.    
  144. <!-- BEGIN: Sticky Footer -->
  145.  
  146.       <!--<img src="https://softweb2sms.thats.im/copyright/assets/images/copyright-ftr.png" title="Send Free SMS | SHIVKR" alt="Send Free SMS | SHIVKR" class="ftrlogo"/>-->
  147.  
  148.       <p class="ftr">Copyright &copy; <?php echo date("Y");?> | FreeSMS </p>
  149.       <p class="ftr"><a href="#" class="encryptClick" style="text-decoration:none;">T&S (Read me)</a></p>
  150.  
  151. <!-- END: Sticky Footer -->
  152. <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script>
  153. <Script>jQuery(function($) {
  154.   // /////
  155.   // CLEARABLE INPUT
  156.   function tog(v){return v?'addClass':'removeClass';}
  157.   $(document).on('input', '.clearable', function(){
  158.     $(this)[tog(this.value)]('x');
  159.   }).on('mousemove', '.x', function( e ){
  160.     $(this)[tog(this.offsetWidth-18 < e.clientX-this.getBoundingClientRect().left)]('onX');  
  161.   }).on('touchstart click', '.onX', function( ev ){
  162.     ev.preventDefault();
  163.     $(this).removeClass('x onX').val('').change();
  164.   });
  165. });</script>
  166. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  167. <script type="text/javascript">
  168.   $(window).load(function() {
  169.     $(".loader").fadeOut("slow");
  170.   })
  171. </script>
  172.      
  173. </body>
  174. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement