Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start();
- include("../UAS_IS1/config.php");
- $user = $_POST['usertxt'];
- $user = str_replace("'","´",$user);
- $psw=$_POST['pswtxt'];
- $psw= str_replace("'","´",$psw);
- $cek = "Select * from tbl_pelanggan where username='".$user."' and password='".md5($psw)."'";
- //menyeleksi ke tabel admin username dan password berdsarkan variabel username dan password
- //untuk password sebelumnya telah dienkripsi dengan fungsi md5
- $hasil = mysql_query($cek);
- $hasil_cek = mysql_num_rows($hasil);
- //jika data tidak ditemukan maka tamplan pesan user dan psw salah
- if ($hasil_cek==0){
- header("location:index.php");
- //echo "Username dan Password yang Anda isi salah...!!!";
- }else{
- //jika data ditemukan maka buka halaman menu utama dan sekaligus membuka session
- $_SESSION['userlogin'] =$user;
- //echo "ada session ".$_SESSION['userlogin'];
- header("location:home.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement