-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontact-submit.php
More file actions
29 lines (19 loc) · 802 Bytes
/
Copy pathcontact-submit.php
File metadata and controls
29 lines (19 loc) · 802 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
28
<?php
include_once 'includes/db.php';
if(isset($_POST['submit'])){
$name=mysqli_real_escape_string($con,$_POST["name"]);
$email=mysqli_real_escape_string($con,$_POST["email"]);
$phone=mysqli_real_escape_string($con,$_POST["phone"]);
$msg=mysqli_real_escape_string($con,$_POST["message"]);
$query = "INSERT INTO contact (name, email, phone, query) VALUES (?,?,?,?)";
$stmt = mysqli_prepare($con, $query);
mysqli_stmt_bind_param($stmt, "ssss", $name, $email, $phone, $msg);
mysqli_stmt_execute($stmt);
?>
<script>
alert("Your query has been registered! Our team will contact you soon...");
location.href="index.php";
</script>
<?php
}
?>