ccc

mail@pastecode.io avatar
unknown
php
2 months ago
665 B
2
Indexable
Never
<?php
    
    // mengaktifkan session php
    session_start();

    //hubungkan koneksi
    include 'FormLoginJibril.php';

    // menangkap data yang dikirim dari form
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    // menesuaikan data admin dengan yang dibutuhkan
    $data = mysqli_query($koneksi,"select * from admin where username='$username' and password='$password'");
   $cek = mysqli_num_rows($data);
   if ($cek > 0){
    $_SESSION['username'] = $username;
    $_SESSION['status'] = "login";
    header("location:admin/index1.php");
   }else{
    header("location:index.php?pesan=gagal");
   }
   ?>
Leave a Comment