-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.php
More file actions
27 lines (24 loc) · 926 Bytes
/
code.php
File metadata and controls
27 lines (24 loc) · 926 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
25
26
27
<?php
$conn= mysqli_connect("localhost","root","","add");
if(isset($_POST['submitButton']))
{
$id=$_POST['id'];
$name=$_POST['name'];
$email=$_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$query = "INSERT INTO `contact`( `name`, `email`, `phone`, `message`) VALUES ('$name','$email','$phone','$message')";
$query_run = mysqli_query($conn,$query);
if($query_run)
{
//echo"working";
$_SESSION['sucesss']="contact Added";
header("Location: index.php");
}
else{
// echo"notworking";
$_SESSION['status']="contact is not added";
header("Location: index.php");
}
}
?>