Initial commit: Setup Landing Page dan file pertemuan
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// Tolak akses jika bukan admin
|
||||
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') {
|
||||
http_response_code(403); // Status Forbidden
|
||||
echo "Akses ditolak! Anda bukan operator.";
|
||||
exit;
|
||||
}
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$nama = $_POST['nama_pemilik'];
|
||||
$status = $_POST['status'];
|
||||
$luas = $_POST['luas'];
|
||||
$koordinat = $_POST['koordinat'];
|
||||
|
||||
// Perhatikan: id dihilangkan, tanda tanya hanya 4
|
||||
$stmt = $conn->prepare("INSERT INTO parsil (nama_pemilik, status, luas, koordinat) VALUES (?, ?, ?, ?)");
|
||||
|
||||
// Perhatikan: huruf ssds (4 huruf untuk 4 variabel)
|
||||
$stmt->bind_param("ssds", $nama, $status, $luas, $koordinat);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
echo "Data Parsil berhasil disimpan!";
|
||||
} else {
|
||||
echo "Gagal: " . $conn->error;
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
}
|
||||
Reference in New Issue
Block a user