-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomplain.php
More file actions
42 lines (32 loc) · 1.39 KB
/
complain.php
File metadata and controls
42 lines (32 loc) · 1.39 KB
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
<?php
$servername = "localhost";
$username = "id11831593_acecal";
$password = "acecalgoa";
$dbname = "id11831593_goa";
$phonenumber = $_POST["phonenumber"];
$pincode = $_POST["pincode"];
$imgurl = $_POST["imgurl"];
$longitude = $_POST["longitude"];
$latitude = $_POST["latitude"];
// $phonenumber = substr($phonenumber,1);
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$cidd = mysqli_query($conn, "select phonenumber from civilagencies where pincode = $pincode limit 1");
if (mysqli_num_rows($cidd) > 0) {
// output data of each row
while($cid = mysqli_fetch_assoc($cidd)) {
$sql = "INSERT INTO complaint (userphonenumber, pincode, latitude, longitude, imgurl, caphonenumber)
VALUES ($phonenumber, $pincode, '$latitude', '$longitude', '$imgurl', $cid[phonenumber] )";
}
}
//$sql = "INSERT INTO complaint (userphonenumber, pincode, latitude, longitude, imgurl, caphonenumber)
// VALUES ($phonenumber, $pincode, '$latitude', '$longitude', '$imgurl', $cidd )";
if (mysqli_query($conn, $sql)) {
$cid = mysqli_query($conn, "select id from complaint where pincode = $pincode limit 1");
}
echo "Complaint Submitted!!! <br/> <center><a href=https://acecal.000webhostapp.com/goa/>Help Build Goa</a></center>";
?>