-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact2.php
224 lines (193 loc) · 8.68 KB
/
contact2.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html>
<head>
<title>BrekfastRecipe</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Philosopher' rel='stylesheet'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="validate.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css" >
</head>
<body class="container-fluid bdwdt">
<!-- start of header navbar -->
<div class="container-fluid">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php" class="navbar-brand"><img src="imgg/logo.png" alt="" class="logo"></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav" class="active">
<li><a href="index.php" class="sty">Home</a></li>
<li><a href="breakfast.php" class="sty">Breakfast</a></li>
<li class="active"><a href="contact2.php" class="sty">Contact-Us</a></li>
<li><a href="About.php" class="sty">About-Us</a></li>
</ul>
<li style="list-style: none;">
<input placeholder="Search....." type="text" name="search" class="srh">
<button class="btn btn-default bt" type="button" >Search</button></li>
</nav>
</div>
<!-- End of Navbar/ Header -->
<!-- contactUs form -->
<div class="cnt1">
<section id="contact" style="">
<div class="container">
<div class="row">
<div class="about_our_company" style="margin-bottom: 20px;">
<h1 style="color:#fff;">Contact-Us For Further Details</h1>
<div class="titleline-icon"></div>
<p style="color:#fff;">Lorem Ipsum is simply dummy text of the printing and typesetting </p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<form action="contact2.php" method="post" name="sentMessage" id="contactForm" onsubmit="return validate">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label style="color:#fff;">Enter Name:</label>
<input type="text" name="name" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name.">
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<label style="color:#fff;">Enter Email:</label>
<input type="email" name="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address.">
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<label style="color:#fff;">Phone No:</label>
<input type="tel" name="contact" class="form-control" placeholder="Your Phone *" id="phone" required data-validation-required-message="Please enter your phone number.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="comment" style="color:#fff;">Remarks:</label>
<textarea name="comment" class="form-control" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."></textarea>
<p class="help-block text-danger"></p>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12 text-center">
<div id="success"></div>
<button name="submit" type="submit" class="btn btn-xl get">Send Message</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<p style="color:#fff;">
<strong><i class="fa fa-map-marker"></i> Address</strong><br>
Smiu Karachi, Sindh
</p>
<p style="color:#fff;"><strong><i class="fa fa-phone"></i> Phone Number</strong><br>
(+92)2123456</p>
<p style="color:#fff;">
<strong><i class="fa fa-envelope"></i> Email Address</strong><br>
<p></p>
</div>
</div>
</div>
</section>
</div>
<!-- end of contact us -->
<!-- form code start -->
<!-- Footer staRT coding -->
<footer class="nb-footer">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="about">
<img src="images/logo.png" class="img-responsive center-block" alt="">
<p>We are here to help u in recipies and make your life easir to learn how to cock and to know Breakfst recipies </p>
<div class="social-media">
<ul class="list-inline">
<li><a href="https://www.facebook.com/Breakfast-Recipe-1575054712523858/" target="_blank" title=""><i class="fa fa-facebook"></i></a></li>
<li><a href="https://twitter.com/FUNFOR4LIFE" target="_blank" title=""><i class="fa fa-twitter"></i></a></li>
<li><a href="https://plus.google.com/u/0/+NabeelAhmedKhan_Nak" target="_blank" title=""><i class="fa fa-google-plus"></i></a></li>
<li><a href="https://www.linkedin.com/in/nabeel-khan-nak/" target="_blank" title=""><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footer-info-single">
<h2 class="title">Help Center</h2>
<ul id="ttn3" style=" font-weight: bold ; color: white;">
<li>Contact: +92344-*******</li>
<li>Email:</li>
</ul>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footer-info-single">
<h2 class="title"><a href="About.php" title=""><i class="fa fa-angle-double-right"></i> About Us</a></h2>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footer-info-single">
<h2 class="title"><a href="contact2.php" title=""><i class="fa fa-angle-double-right"></i> Contact Us</a></h2>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footer-info-single">
<h2 class="title"><a href="#" title=""><i class="fa fa-angle-double-right"></i> FAQ's</a></h2>
</div>
</div>
</div>
</div>
<section class="copyright">
<div class="container">
<div class="row">
<div class="col-sm-6">
<p>Copyright © 2017. Breakfast Recipe.</p>
</div>
<div class="col-sm-6"></div>
</div>
</div>
</section>
</footer>
<!-- End of Footer -->
</body>
</html>
<!-- PHP server code -->
<?php
$servername="localhost";
$username="databasenk";
$password="123";
$dbname="databasenk";
// CREATE CONNECTION
$conn = new mysqli($servername,$username,$password,$dbname);
//check connection
if($conn->connect_error){
die("connection failed:".$conn->connect_error);
}
if (isset($_POST['submit'])) {
$contact = $_POST['contact'];
$name = $_POST['name'];
$email = $_POST['email'];
$remarks = $_POST['comment'];
# code...
$sql="INSERT INTO nk (contact,name,email,comment) values('$contact','$name','$email','$remarks')";
if ($conn->query($sql)===TRUE) {
#echo "New record created successfully";
echo '<script language="javascript">';
echo 'alert("message successfully sent")';
echo '</script>';
# code...
}
else{
echo "Error:".$sql."<br>".$conn->error;
}
}
?>
<!-- end of php -->