Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include 'database/koneksi.php';
- if(isset($_POST['login']))
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $login = mysqli_query($koneksi,"select * from users where username='$username' and password='$password'");
- $cek = mysqli_num_rows($login);
- if($run > 0){
- $data = mysqli_fetch_assoc($login);
- if($data['user_type']=="1"){
- $_SESSION['username'] = $username;
- $_SESSION['user_type'] = "1";
- header("location:donatur/index.php");
- }else if($data['user_type']=="2"){
- $_SESSION['username'] = $username;
- $_SESSION['user_type'] = "2";
- header("location:index.php");
- }else{
- header("location:login.php?pesan=gagal");
- }
- }else{
- header("location:login.php?pesan=gagal");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement