Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- @session_start();
- include "inc/koneksi.php";
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Halaman Login</title>
- <style type="text/css">
- body{
- font-family: arial;
- font-size: 14px;
- background-color: #222;
- }
- #utama{
- width: 300px;
- margin: 0 auto;
- margin-top: 12%;
- }
- #judul{
- padding: 15px;
- text-align: center;
- color: #fff;
- font-size: 20px;
- background-color: #F00;
- border-top-right-radius: 10px;
- border-top-left-radius: 10px;
- border-bottom: 3px solid #336666;
- }
- #inputan{
- background-color: #999;
- padding: 20px;
- border-bottom-right-radius: 10px;
- border-bottom-left-radius: 10px;
- }
- input{
- padding: 10px;
- border: 0;
- }
- .lg{
- width: 240px;
- }
- .btn{
- background-color: #f00;
- border-radius: 10px;
- color: #fff;
- width: 260px;
- }
- .btn:hover{
- background-color: #F03;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div id="utama">
- <div id="judul">
- Halaman Login
- </div>
- <div id="inputan">
- <form action="" method="post">
- <div>
- <input type="text" name="user" placeholder="Username" class="lg" />
- </div>
- <div style="margin-top:10px">
- <input type="password" name="pass" placeholder="Password" class="lg" />
- </div>
- <div style="margin-top:10px">
- <input type="submit" name="login" value="Login" class="btn" />
- </div>
- </form>
- <?php
- $user = @$_POST['user'];
- $pass = @$_POST['pass'];
- $login = @$_POST['login'];
- if($login) {
- if($user == "" || $pass == ""){
- ?> <script type="text/javascript">alert("Username / Password Tidak Boleh Kosong");</script> <?php
- } else {
- $sql = mysql_query("select * from tb_login where username = '$user' and password = '$pass'") or die (mysql_error());
- $data = mysql_fetch_array($sql);
- $cek = mysql_num_rows($sql);
- if($cek >= 1){
- @$_SESSION['jabatan'] = $data['jabatan'];
- header("location: /poliklinik/index.php");
- } else {
- echo "Login Gagal cuk -_-";
- }
- }
- }
- ?>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement