-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenquiry.php
34 lines (34 loc) · 894 Bytes
/
enquiry.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
<?php
$firstname = $_POST['firstname'];
$lastname =$_POST['lastname'];
$email = $_POST['email'];
$address =$_POST['address'];
$phone =$_POST['phone'];
$message =$_POST['message'];
$submit =$_POST['submit'];
//databse connection
$con = new mysqli("localhost","root","","website");
if(!$con)
{
echo "connection failed".mysqli_connect_error();
}
if($_POST['submit'])
{
$firstname = $_POST['firstname'];
$lastname =$_POST['lastname'];
$email = $_POST['email'];
$address =$_POST['address'];
$phone =$_POST['phone'];
$message =$_POST['message'];
$query = "insert into enquiry values('$firstname','$lastname','$email','$address','$phone','$message')";
$data = mysqli_query($con,$query);
}
if($data)
{
echo "enquiry received";
}
else
{
echo "submission failed";
}
?>