-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-script.php
41 lines (37 loc) · 1.16 KB
/
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
34
35
36
37
38
39
40
41
<?php
include 'contact.php';
//Create Connection
$servername = "localhost";
$username = "root";
$password = "";
$database = "voiceup";
$con = mysqli_connect($servername, $username, $password,$database);
if (!$con) {
die(" Connection Error ");
}
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 = $con->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> -->