-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathprocess.php
More file actions
55 lines (41 loc) · 1.18 KB
/
Copy pathprocess.php
File metadata and controls
55 lines (41 loc) · 1.18 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
$hostname="localhost:3306";
$username="ietebits_abhishek";
$password="iete@2017";
$database="ietebits_ietebits";
$dbConnected = mysqli_connect($hostname, $username, $password);
$dbSelected = mysqli_select_db($dbConnected, $database);
$dbSuccess = True;
if($dbConnected){
if($dbSelected){
}
else{
echo "<script>alert('We\'ve encountered an Error')</script>";
$dbSuccess = False;
}
}
else {
echo "<script>alert('We\'ve encountered an Error')</script>";
}
if ($dbSuccess){
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$message = $_POST['message'];
$query = "INSERT INTO `messages`(`First Name`, `Last Name`, `Email`, `Message`)";
$query .= "VALUES ('$fname'";
$query .=",'$lname'";
$query .=",'$email'";
$query .=",'$message'";
$query .=")";
$check = mysqli_query($dbConnected, $query);
if($check){
echo "<script>alert('Thank You For Messaging Us !');</script>";
echo "<script> location.href='contact.php'; </script>";
}
else
{
echo "<script>alert('We\'ve encountered an Error, try again');</script>"
}
}
?>