Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <br/>
- <br/>
- <center><h2>SISTEM PENDUKUNG KEPUTUSAN</h2>
- <h2>PEMILIHAN KARYAWAN TERBAIK</H2>
- </center>
- <br/>
- <div class="login">
- <br/>
- <form action="login.php" method="post" onSubmit="return validasi()">
- <div>
- <label>Username:</label>
- <input type="text" name="username" id="username" />
- </div>
- <div>
- <label>Password:</label>
- <input type="password" name="password" id="password" />
- </div>
- <div>
- <input type="submit" value="Login" class="tombol">
- </div>
- </form>
- <?php
- include 'config.php';
- $username = $_POST['username'];
- $password = $_POST['password'];
- $login = mysql_query("select * from tbl_admin where username='$username' and password='$password'");
- $cek = mysql_num_rows($login);
- if($cek > 0){
- session_start();
- $_SESSION['username'] = $username;
- $_SESSION['status'] = "login";
- header("location:index.php");
- }else{
- header("location:admin/halaman/index.php");
- }
- ?>
- </div>
- </body>
- <script type="text/javascript">
- function validasi() {
- var username = document.getElementById("username").value;
- var password = document.getElementById("password").value;
- if (username != "" && password!="") {
- return true;
- }else{
- alert('Username dan Password harus di isi !');
- return false;
- }
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement