-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend-request.php
More file actions
24 lines (19 loc) · 810 Bytes
/
Copy pathsend-request.php
File metadata and controls
24 lines (19 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
include("config/db.php");
if(isset($_SESSION['name'], $_SESSION['ration'], $_POST['member'], $_POST['rice'])) {
$name = mysqli_real_escape_string($conn, $_SESSION['name']);
$ration = mysqli_real_escape_string($conn, $_SESSION['ration']);
$member = mysqli_real_escape_string($conn, $_POST['member']);
$rice = mysqli_real_escape_string($conn, $_POST['rice']);
$sql = "INSERT INTO ration_requests (citizen_name, ration_card, member_name, rice_kg, status)
VALUES ('$name', '$ration', '$member', '$rice', 'Pending')";
if(mysqli_query($conn, $sql)) {
$_SESSION['request_id'] = mysqli_insert_id($conn);
header("Location: verify-otp.php");
exit;
}
echo "Error: " . mysqli_error($conn);
exit;
}
echo "Invalid Request";