initial commit pemetaan kemiskinan
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
session_start();
|
||||
include "../config/koneksi.php";
|
||||
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
$query = mysqli_query($conn, "
|
||||
SELECT * FROM users
|
||||
WHERE username='$username' AND password='$password'
|
||||
");
|
||||
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
|
||||
if($data){
|
||||
$_SESSION['id'] = $data['id'];
|
||||
$_SESSION['nama'] = $data['nama'];
|
||||
$_SESSION['role'] = $data['role'];
|
||||
|
||||
header("Location: ../index.php");
|
||||
}else{
|
||||
echo "Login gagal";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user