-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-script.php
33 lines (29 loc) · 981 Bytes
/
contact-script.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
<?php
include 'contact.php';
include 'sql.php';
if (isset($_POST["submit"])) {
$user_name = $_POST['user_name'];
$user_mobile = $_POST['user_mobile'];
$user_email = $_POST['user_email'];
$user_address = $_POST['user_address'];
$user_message = $_POST['user_message'];
$show_modal = false;
$query = "INSERT into contactus(c_name,c_mobile,c_email,c_address,c_message) VALUES('$user_name','$user_mobile','$user_email','$user_address','$user_message')";
$success = $conn->query($query);
if ($success) {
echo "<script type='text/javascript'>
$('#mysuccessModal').modal('show');
function pagesuccessRedirect() {
location.replace('index.php');
}</script>";
} else {
echo "<script type='text/javascript'>
$('#myunsuccessModal').modal('show');
function pageunsuccessRedirect() {
location.replace('contact.php');
}</script>";
}
}
?>
<!-- <html>
</html> -->