-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
69 lines (48 loc) · 1.48 KB
/
contact.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
include "header.php";
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$email = $_POST['email'];
$name = $_POST['name'];
$subject = $_POST['subject'];
$body = $_POST['body'];
$sql = "Insert into feedback(email, name, subject, body)
values (:email, :name,:subject, :body)";
$q = $DBH->prepare($sql);
$q->execute(array(':email'=>$email,
':name'=>$name,
':subject'=>$subject,
':body'=>$body
));
header("location: index.php");
}
?>
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<h1>Contact Us</h1><br />
<p>Fill out the form below to send your comments.</p>
<form class="form" action="" method="POST">
<div class="form-group">
<label for="emal">Your Email address</label>
<input class="form-control" id="email" type="email" name="email" required>
</div>
<div class="form-group">
<label for="name">Your Name</label>
<input class="form-control" id="name" type="text" name="name" required>
</div>
<div class="form-group">
<label for="subject">Subject</label>
<input class="form-control" id="subject" type="text" name="subject" required>
</div>
<div class="form-group">
<label for="body"></label>
<textarea name = "body" class="form-control" id="textarea" rows="3" cols="70" required></textarea>
</div>
<button name="submit" type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
<?php
include "footer.php";
?>
</body>
</html>