-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchkmissingcitizen.php
51 lines (46 loc) · 1.49 KB
/
chkmissingcitizen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
error_reporting(0);
session_start();
include("config.php");
$firstname = $_POST['fname'];
$middlename = $_POST['mname'];
$lastname = $_POST['lname'];
$date = $_POST['date'];
$m = substr($date,0,2);
$d = substr($date,3,2);
$y = substr($date,6,4);
$date = $y."-".$m."-".$d;
$time2 = $_POST['time2'];
$gender = $_POST['gender'];
$address =$_POST['address'];
$areaname = $_POST['area'];
$city =$_POST['city'];
$contactno = $_POST['contactno'];
$emailid= $_POST['emailid'];
$missingdesc=$_POST['missingdesc'];
$specialclue=$_POST['specialclue'];
$photo = "upload/".$_FILES['photo']['name'];
if(move_uploaded_file($_FILES['photo']['tmp_name'],$photo))
{
$insertQuery = "insert into mstr_missingcitizen(first_name,middle_name,last_name,date,time,gender,address,
contact_no,description,special_clue,email_id,username,city_id,area_id,photo)
values ('".$firstname."','".$middlename."','".$lastname."','".$date."',
'".$time2."','".$gender."','".$address."','".$contactno."','".$missingdesc."',
'".$specialclue."','".$emailid."','".$_SESSION['username']."','".$city."',
'".$areaname."','".$photo."')";
$msg = base64_encode("Registered Successfully");
//echo "$insertQuery";
if(mysql_query($insertQuery))
{
header("location:home.php?msg=$msg");
}
else
{
header("location:missing_citizen.php?msg=Not Registered");
}
}
else
{
echo "Error in uploading photo";
}
?>