-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
102 lines (91 loc) · 3 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include "head.php";
?>
</head>
<body>
<?php
include "nav.php";$strconn=mysqli_connect("localhost","root","","project");
if(!$strconn)
echo "Connection failed".mysqli_connect_error();
else
{
}
?>
<header id="head" class="secondary">
<div class="container">
<div class="row">
<div class="col-sm-8">
<h1>Contact</h1>
</div>
</div>
</div>
</header>
<!-- container -->
<div class="container">
<div class="row">
<div class="col-md-6">
<h3 class="section-title">Votre message</h3>
<form name="sentMessage" id="contactForm" novalidate method="post" action="">
<div class="control-group">
<div class="controls">
<input type="text" class="form-control"
placeholder="Nom complet" name="name" required
data-validation-required-message="Veuillez entrer votre nom complet" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="email" class="form-control" placeholder="Email"
name="email" required
data-validation-required-message="Veuillez entrer votre email" />
</div>
</div>
<div class="control-group">
<div class="controls">
<textarea rows="10" cols="100" class="form-control"
placeholder="Message" name="message" required
data-validation-required-message="Veuillez entrer votre message" minlength="5"
data-validation-minlength-message="Min 5 characters"
maxlength="999" style="resize:none;margin-top:10px"></textarea>
</div>
</div>
<br>
<div id="success">
<?php
if(isset($_POST['btnsubmit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
// $strInsert="INSERT INTO feedback(Description,name,email) VALUES('$message','$name','$email')";
$strInsert = "insert into feedback values('$message','$name','$email')";
if(mysqli_query($strconn,$strInsert))
echo "<div class='alert alert-success' role='alert'>Merci de nous avoir contacté.</div>";
else
echo "<div class='alert alert-danger' role='alert'>Erreur dans l'envoie.</div>";
}
?>
</div> <!-- For success/fail messages -->
<button type="submit" class="btn btn-primary pull-right" name="btnsubmit" >Envoyé</button><br /><br /><br /><br />
</form>
</div>
</div>
</div>
<?php
include "footer.php";
?>
<!-- JavaScript libs are placed at the end of the document so the pages load faster -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="contact/jqBootstrapValidation.js"></script>
<script src="contact/contact_me.js"></script>
<script src="assets/js/custom.js"></script>
<!-- Google Maps -->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="assets/js/google-map.js"></script>
</body>
</html>