Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'koneksidb.php';
- $username= $_POST['username'];
- $password= md5 ($_POST['password']);
- $sql=mysql_query("select *from tbkaryawan where username='$username' and password='$password'");
- $cari = mysql_num_rows($sql);
- $record = mysql_fetch_array($sql);
- if ($cari>0){
- session_start();
- session_register("username");
- session_register("password");
- $_SESSION['username']=$record['username'];
- $_SESSION['password']= $record['password'];
- $_SESSION['nama']=$record['nm_karyawan'];
- echo "<script>alert ('Login Sukses');
- location='index2.php'</script>";
- }
- else {
- echo "<script>alert ('Password Username Salah');history.go(-1)</script>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement