Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sambung=mysqli_connect("localhost","root","","login");
- $user=$_POST['user'];
- $pass=$_POST['password'];
- $cari=mysqli_query($sambung,"select * from login_admin where user_name='$user' and user_pass='$pass'") or die ("Gagal");
- $lihat=mysqli_num_rows($cari);
- if (isset($_POST['submit']))
- {
- if (empty($user) and empty($pass))
- {
- echo "User name dan Password tidak boleh kosong";
- }
- elseif ($lihat<1) {
- echo "Username dan Password Salah";
- }
- else
- {
- session_start();
- $_SESSION['password']=$pass;
- header("location:admin.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement