Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Script By Andre Gatami
- session_start();
- require_once("koneksi.php");
- $username = $_POST['username'];
- $pass = md5(base64_decode(base64_decode(base64_decode($_POST['password']))));
- $cekuser = mysql_query("SELECT * FROM user WHERE username = '$username'");
- $jumlah = mysql_num_rows($cekuser);
- $hasil = mysql_fetch_array($cekuser);
- if($jumlah == 0) {
- header("location:index.php?pesan=1&isi=Username : $username belum terdaftar.");
- } else {
- if($pass !== $hasil['password']) {
- header("location:index.php?pesan=1&isi=Password yang anda masukkan salah.");
- } else {
- $_SESSION['username'] = $hasil['username'];
- header('location:/');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement