Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Script by Denny Irawan
- ob_start();
- session_start();
- if(isset($_SESSION['username'])) {
- header('location:/');
- }
- require_once("konak.php");
- ?>
- <!DOCTYPE html>
- <!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
- <!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
- <!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
- <!-- BEGIN HEAD -->
- <head>
- <meta charset="UTF-8" />
- <title>Masuk | D'Payer | Transaksi Pulsa,Kuota,Voucher Game Online,PLN secara mudah dan murah.</title>
- <meta content="width=device-width, initial-scale=1.0" name="viewport" />
- <meta content="" name="description" />
- <meta content="" name="author" />
- <!--[if IE]>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <![endif]-->
- <!-- GLOBAL STYLES -->
- <!-- PAGE LEVEL STYLES -->
- <link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.css" />
- <link rel="stylesheet" href="assets/css/login.css" />
- <link rel="stylesheet" href="assets/plugins/magic/magic.css" />
- <script src='https://www.google.com/recaptcha/api.js'></script>
- <!-- END PAGE LEVEL STYLES -->
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
- </head>
- <!-- END HEAD -->
- <!-- BEGIN BODY -->
- <body >
- <!-- PAGE CONTENT -->
- <div class="container">
- <div class="text-center">
- <a href="index.php"><img src="assets/img/logo1.png" width="250" height="80" alt="" /></a>
- </div>
- <div class="tab-content">
- <div id="login" class="tab-pane active">
- <!-- INI PROSES LOGIN -->
- <?php if(isset($_POST['submit'])) {
- $username = $_POST['username'];
- $pass = $_POST['password'];
- //Captcha
- $captcha = isset($_POST['g-recaptcha-response']) ? $_POST['g-recaptcha-response']:'';
- $secret_key = '6LfuZTEUAAAAAARv6RIb4k2xeMA4L-lEC-PyyXqp';
- $cekuser = mysql_query("SELECT * FROM user WHERE username = '$username'");
- $jumlah = mysql_num_rows($cekuser);
- $get = mysql_fetch_array($cekuser);
- $angka = $get['max'];
- //Cek IP
- $cekip = mysql_query("SELECT * FROM session WHERE username = '$username'");
- $ccc = mysql_fetch_array($cekip);
- $ipnya = $ccc['ip'];
- //////=============DAPAT IP=============\\\\\\\\\\\
- $ip = $_SERVER['REMOTE_ADDR'];
- //================================================\\
- //Verifikasi user
- $option = ['cost'=>10,];
- $hash = password_hash($pass, PASSWORD_DEFAULT, $option);
- if($jumlah == 0) { // user tdk terdaftar ?>
- <div class="alert alert-danger"> <strong>Username atau Password Tidak Terdaftar.</strong> </div>
- <script>
- swal("Error!", "Data tidak terdaftar.", "error");
- </script>
- <? } else if($pass <> $get['password']) { ?>
- <div class="alert alert-danger"> <strong>Username atau Password salah!</strong> </div>
- <script>
- swal("Error!", "Data yang dimasukkan tidak sesuai.", "error");
- </script>
- <? } else if($ipnya != $ip) { // user tdk terdaftar ?>
- <div class="alert alert-danger"> <strong>Gagal</strong> IP anda berubah, silahkan login kembali. </div>
- <? $destroyy = mysql_query("UPDATE session SET ip = '$ip' WHERE username = '$username");
- }else if ($captcha != ''){
- $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secret_key) . '&response=' . $captcha;
- $recaptcha = file_get_contents($url);
- $recaptcha = json_decode($recaptcha, true);
- if (!$recaptcha['success']) { ?>
- <div class="alert alert-danger"> <strong>Harap Verifikasi Captcha !</strong> </div>
- <? } else { ?>
- <div class="alert alert-success"> <center><strong>Login Berhasil, Tunggu sebentar!</strong><br><font size="1">Jika tidak dialhikan, <a href="index.php">Klik Disini</a></font></center></div>
- <? if ($_SESSION['username'] = $get['username']){
- //$snd = mysql_query("INSERT INTO session (username) VALUES ('$usernamee')");
- $snd = mysql_query("UPDATE session SET ip = '$ip' WHERE username = '$username'");
- $usermax = mysql_query("UPDATE user SET max='1' WHERE username= '$username'") or die (mysql_error()); ?>
- <script language=javascript>
- setTimeout("location.href='http://pulsa.lengkomedia.com'", 5000);
- </script>
- <? }
- } ?>
- <? } else { ?>
- <div class="alert alert-danger"> <strong>Harap Verifikasi Captcha !</strong> </div>
- <? } } ?>
- <form class="form-signin" id="login-form" method="post" name="login-form" method="POST">
- <p class="text-muted text-center btn-block btn btn-primary btn-rect">
- Masukan Username & Password anda!
- </p>
- <input type="text" id="username" name="username" placeholder="Username" class="form-control" required/>
- <input type="password" id="password" name="password" placeholder="Password" class="form-control" required/>
- <div class="g-recaptcha" data-sitekey="6LfuZTEUAAAAALTt1YOckNfBEDZDnzA_5o2KGaFB"></div>
- <button class="btn text-muted text-center btn-info" name="submit" type="submit">Masuk</button>
- <button class="btn text-muted text-center btn-default" type="reset">Clear/Reset</button>
- </form>
- </div>
- <!-- BEGIN FORGOT PASSWORD
- <div id="forgot" class="tab-pane">
- <form action="index.html" class="form-signin">
- <p class="text-muted text-center btn-block btn btn-primary btn-rect">Enter your valid e-mail</p>
- <input type="email" required="required" placeholder="Your E-mail" class="form-control" />
- <br />
- <button class="btn text-muted text-center btn-success" type="submit">Recover Password</button>
- </form>
- </div>
- <!-- END FORGOT PASSWORD -->
- <div id="signup" class="tab-pane">
- <form method="post" name="pendaftaran" class="form-signin">
- <p class="text-muted text-center btn-block btn btn-primary btn-rect">Please Fill Details To Register</p>
- <input type="text" name="username" placeholder="Username" class="form-control" required/>
- <input type="email" name="email" placeholder="Email" class="form-control" required/>
- <input type="password" name="passwor" placeholder="password" class="form-control" required/>
- <button class="btn text-muted text-center btn-success" type="submit" name="add">Register</button>
- </form>
- </div>
- </div>
- <div class="text-center">
- <ul class="list-inline">
- <li><a class="text-muted" href="#login" data-toggle="tab">Login</a></li>
- <!-- END FORGOT PASSWORD <li><a class="text-muted" href="#forgot" data-toggle="tab">Forgot Password</a></li> -->
- <li><a class="text-muted" href="forgot.php">Forgot your Password?</a></li>
- <li><a class="text-muted" href="daftar.php">Signup</a></li>
- <li><a class="text-muted" href="listharga.php">List Harga</a></li>
- </ul>
- </div>
- </div>
- <!--END PAGE CONTENT -->
- <!-- PAGE LEVEL SCRIPTS -->
- <script src="assets/plugins/jquery-2.0.3.min.js"></script>
- <script src="assets/plugins/bootstrap/js/bootstrap.js"></script>
- <script src="assets/js/login.js"></script>
- <!--END PAGE LEVEL SCRIPTS -->
- </body>
- <!-- END BODY -->
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement