-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontactDemo.php
45 lines (39 loc) · 1.6 KB
/
contactDemo.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
42
43
44
45
<?php
require('./dbconn.php');
$page_title = "Reach Us";
$name = $phone = $email = $subject = $msg = "";
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$msg = $_POST['message'];
$query = "INSERT INTO demo (name,email,phone,subject,message)
VALUES('{$name}','{$email}','{$phone}','{$subject}','{$msg}')";
if (mysqli_query($conn, $query)) {
echo "Your message has been sent";
}
}
?>
<div class="col-lg-6">
<form action="" method="post" role="form" class="php-email-form" enctype="multipart/form-data">
<div class="form-group">
<input type="text" name="name" class="form-control" id="name" placeholder="Your Name" required>
</div>
<div class="row">
<div class="col form-group">
<input type="text" class="form-control" name="phone" id="phone" placeholder="Your Phone no." >
</div>
<div class="col form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email" >
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" >
</div>
<div class="form-group">
<textarea class="form-control" name="message" rows="5" placeholder="Message" ></textarea>
</div>
<div class="text-center"><button type="submit" name="submit">Send Message</button></div>
</form>
</div>