-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoformmain.php
38 lines (29 loc) · 950 Bytes
/
oformmain.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
<?php
$conn=mysqli_connect("localhost","root","","home");
if(!$conn){
die("connection failed".mysqli_connect_error());
}
echo "succesfull";
$flatname =$_POST['flatname'];
$location=$_POST['location'];
$rent=$_POST['rent'];
$meal=$_POST['meal'];
$bathroom =$_POST['bathroom'];
$area=$_POST['area'];
$BHK=$_POST['BHK'];
$date=$_POST['date'];
$dropdown =$_POST['dropdown'];
$furniture=$_POST['furniture'];
$amenities=$_POST['amenities'];
$amen=implode(",",$amenities);
// echo $amen;
$query="INSERT INTO oform(flatname,location,rent,meal,bathroom,area,BHK,date,dropdown,furniture,amenities)
VALUES('$flatname','$location','$rent','$meal','$bathroom','$area','$BHK','$date','$dropdown','$furniture','$amen')";
$data=mysqli_query($conn,$query);
if($data){
echo"Data inserted successfully";
}
else{
echo"Data insertion failed";
}
?>