Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../../config/koneksi.php';
- // username and password sent from form
- $myusername=$_POST['username'];
- $mypassword=md5($_POST['password']);
- $siswa=mysql_num_rows(mysql_query("SELECT * FROM siswa WHERE idSiswa='$myusername' and password='$mypassword'"));
- if($siswa==1){
- session_start();
- $_SESSION['user']=$myusername;
- $_SESSION['hak']="siswa";
- $_SESSION['agent']=md5($_SERVER['HTTP_USER_AGENT']);
- header("location:../index.php");
- }else{
- echo "<script>alert('Login gagal!'); document.location.href=\"index.php\"</script>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement