Advertisement
karlokokkak

Untitled

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