Advertisement
ahsanshofa

login.php-yukcoding

Jun 5th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.91 KB | None | 0 0
  1. <?php  
  2. require_once "../_config/config.php";
  3. ?>
  4.  
  5. <!doctype html>
  6. <html lang="en" class="fullscreen-bg">
  7.  
  8. <head>
  9.     <title>Micross-RS || Microsscopein</title>
  10.     <meta charset="utf-8">
  11.     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  12.     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  13.     <!-- VENDOR CSS -->
  14.     <link rel="stylesheet" href="<?=base_url()?>../_assets/assets/css/bootstrap.css">
  15.     <link rel="stylesheet" href="<?=base_url()?>../_assets/assets/vendor/font-awesome/css/font-awesome.min.css">
  16.     <link rel="stylesheet" href="<?=base_url()?>../_assets/assets/vendor/linearicons/style.css">
  17.     <!-- MAIN CSS -->
  18.     <link rel="stylesheet" href="<?=base_url()?>../_assets/assets/css/main.css">
  19.     <!-- GOOGLE FONTS -->
  20.     <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
  21.     <!-- ICONS -->
  22.     <link rel="apple-touch-icon" sizes="76x76" href="<?=base_url()?>../_assets/assets/img/apple-icon.png">
  23.     <link rel="icon" type="image/png" sizes="96x96" href="<?=base_url()?>../_assets/assets/img/favicon.png">
  24. </head>
  25.  
  26. <body>
  27.     <!-- WRAPPER -->
  28.     <div id="wrapper">
  29.         <div class="vertical-align-wrap">
  30.             <div class="vertical-align-middle">
  31.                 <div class="auth-box ">
  32.                     <div class="left">
  33.                         <div class="content">
  34.                             <div class="header">
  35.                                 <div class="logo text-center"><img src="../_assets/assets/img/micross-logo.png" alt="Microsscopein"></div>
  36.                                 <p class="lead">Login to your account</p>
  37.                             </div>
  38.                                         <?php  
  39.                                             if (isset($_POST['login']))
  40.                                             {
  41.                                                 $user = trim(mysqli_real_escape_string($con, $_POST['user']));
  42.                                                 $pass = sha1(trim(mysqli_real_escape_string($con, $_POST['pass'])));
  43.                                                 $sql_login = mysqli_query($con, "SELECT * FROM tb_user WHERE user_name = '$user' AND password = '$pass'") or die (mysqli_error($con));
  44.                                                 if(mysqli_num_rows($sql_login)>0)
  45.                                                 {
  46.                                                     $_SESSION['user'] = $user;
  47.                                                     echo "<script>window.location='".base_url."';</script>";
  48.                                                 } else { ?>
  49.                                                     <div class="row">
  50.                                                         <div class="col-lg-6 col-lg-offset-3">
  51.                                                             <div class="alert alert-danger alert-dismissable" role="alert">
  52.                                                                 <a href="" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  53.                                                                 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  54.                                                                 <strong>Login Gagal...!</strong> Username / Password Salah
  55.                                                             </div>
  56.                                                         </div>
  57.                                                     </div>
  58.                                                     <?php
  59.                                                 }
  60.                                             }
  61.                                         ?>
  62.                             <form action="" class="form-auth-small" method="post">
  63.                                 <div class="form-group">
  64.                                     <label for="username" class="control-label sr-only">Username</label>
  65.                                     <input type="text" name="user" class="form-control" placeholder="username" required autofocus>
  66.                                 </div>
  67.                                 <div class="form-group">
  68.                                     <label for="password" class="control-label sr-only">Password</label>
  69.                                     <input type="password" name="pass" class="form-control" placeholder="Password" required autofocus>
  70.                                 </div>
  71.                                 <div class="form-group">   
  72.                                 <button type="submit" class="btn btn-primary btn-lg btn-block" value="login">LOGIN</button>
  73.                                 </div>
  74.                             </form>
  75.                         </div>
  76.                     </div>
  77.                     <div class="right">
  78.                         <div class="overlay"></div>
  79.                         <div class="content text">
  80.                             <h1 class="heading">Micross-RS || Microsscopein</h1>
  81.                             <p>Developer by: <a href="http://ofaprogramming.ga/" target="_blank">ofaprogramming</a></p>
  82.                         </div>
  83.                     </div>
  84.                     <div class="clearfix"></div>
  85.                 </div>
  86.             </div>
  87.         </div>
  88.     </div>
  89.     <!-- END WRAPPER -->
  90.     <script src="<?=base_url('_assets/assets/vendor/jquery/jquery.js')?>"></script>
  91.     <script src="<?=base_url('_assets/assets/vendor/bootstrap/bootstrap.js')?>"></script>
  92. </body>
  93.  
  94. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement