-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
425 lines (357 loc) · 18.4 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
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<?php
require_once './vendor/autoload.php';
$helperLoader = new SplClassLoader('Helpers', './vendor');
$mailLoader = new SplClassLoader('SimpleMail', './vendor');
$helperLoader->register();
$mailLoader->register();
use Helpers\Config;
use SimpleMail\SimpleMail;
$config = new Config;
$config->load('./config/config.php');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = stripslashes(trim($_POST['name']));
$email = stripslashes(trim($_POST['email']));
$phone = stripslashes(trim($_POST['phone']));
$message = stripslashes(trim($_POST['message']));
$pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i';
if (preg_match($pattern, $name) || preg_match($pattern, $email)) {
die("Header injection detected");
}
$emailIsValid = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($name && $email && $emailIsValid && $message) {
$mail = new SimpleMail();
$mail->setTo($config->get('emails.to'));
$mail->setFrom($config->get('emails.from'));
$mail->setSender($name);
$mail->setSenderEmail($email);
$mail->setSubject("Contact Form Details");
$body = "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<meta charset=\"utf-8\">
</head>
<body>
<h1>{$subject}</h1>
<p><strong>{$config->get('fields.name')}:</strong> {$name}</p>
<p><strong>{$config->get('fields.email')}:</strong> {$email}</p>
<p><strong>{$config->get('fields.phone')}:</strong> {$phone}</p>
<p><strong>{$config->get('fields.message')}:</strong> {$message}</p>
</body>
</html>";
$mail->setHtml($body);
$mail->send();
$emailSent = true;
} else {
$hasError = true;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Maasik - Contact</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/favicon.png" />
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/themify/themify-icons.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/elegant-font/html-css/style.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/slick/slick.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
<script src="https://smtpjs.com/v3/smtp.js"></script>
<!-- =============================================================================================-->
</head>
<body class="animsition">
<!-- Header -->
<header class="header1">
<!-- Header desktop -->
<div class="container-menu-header">
<div class="topbar">
<div class="topbar-social">
<a href="https://www.facebook.com/Maasik-474606726405149/?ref=br_rs" target="_blank" class="topbar-social-item fa fa-facebook"></a>
<a href="#" class="topbar-social-item fa fa-instagram" target="_blank"></a>
<!-- <a href="#" class="topbar-social-item fa fa-youtube-play"></a> -->
<a href="https://www.linkedin.com/company/maasik/" target="_blank" class="topbar-social-item fa fa-linkedin"></a>
</div>
<!-- <span class="topbar-child1">
Free shipping for standard order over Rs. 500
</span> -->
<div class="topbar-child2">
<span class="topbar-email">
info@maasik.in
</span>
<!-- <div class="topbar-language rs1-select2">
<select class="selection-1" name="time">
<option>USD</option>
<option>EUR</option>
</select>
</div> -->
</div>
</div>
<div class="wrap_header">
<!-- Logo -->
<a href="index.php" class="logo">
<img src="images/icons/logo.png" alt="IMG-LOGO">
</a>
<!-- Menu -->
<div class="wrap_menu ml-auto">
<nav class="menu">
<ul class="main_menu">
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="about.php">About Us</a>
</li>
<li>
<a href="product.php">Products</a>
</li>
<li>
<a href="contact.php">Contact</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- Header Mobile -->
<div class="wrap_header_mobile">
<!-- Logo moblie -->
<a href="index.php" class="logo-mobile">
<img src="images/icons/logo.png" alt="IMG-LOGO">
</a>
<div class="btn-show-menu-mobile hamburger hamburger--squeeze">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</div>
</div>
</div>
<!-- Menu Mobile -->
<div class="wrap-side-menu">
<nav class="side-menu">
<ul class="main-menu">
<li class="item-topbar-mobile p-l-20 p-t-8 p-b-8">
<div class="topbar-child2-mobile">
<span class="topbar-email">
info@maasik.in
</span>
</div>
</li>
<li class="item-topbar-mobile p-l-10">
<div class="topbar-social-mobile">
<a href="https://www.facebook.com/Maasik-474606726405149/?ref=br_rs" target="_blank" class="topbar-social-item fa fa-facebook"></a>
<a href="#" class="topbar-social-item fa fa-instagram" target="_blank"></a>
<!-- <a href="#" class="topbar-social-item fa fa-youtube-play"></a> -->
<a href="https://www.linkedin.com/company/maasik/" target="_blank" class="topbar-social-item fa fa-linkedin"></a>
</div>
</li>
<li class="item-menu-mobile">
<a href="index.php">Home</a>
</li>
<li class="item-menu-mobile">
<a href="about.php">About Us</a>
</li>
<li class="item-menu-mobile">
<a href="product.php">Products</a>
</li>
<li class="item-menu-mobile">
<a href="contact.php">Contact</a>
</li>
</ul>
</nav>
</div>
</header>
<!-- Title Page -->
<section class="bg-title-page p-t-40 p-b-50 flex-col-c-m background-banner">
<h2 class="l-text2 t-center">
Contact
</h2>
</section>
<!-- content page -->
<section class="bgwhite p-t-66 p-b-60">
<div class="container">
<div class="row">
<div class="col-md-6 p-b-30">
<div class="p-r-20 p-r-0-lg">
<div class="contact-map size21" id="google_map" data-map-x="40.614439" data-map-y="-73.926781" data-pin="images/icons/icon-position-map.png" data-scrollwhell="0" data-draggable="1"></div>
</div>
</div>
<div class="col-md-6 p-b-30">
<?php if(!empty($emailSent)): ?>
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-success text-center"><?php echo $config->get('messages.success'); ?></div>
</div>
<?php else: ?>
<?php if(!empty($hasError)): ?>
<div class="col-md-5 col-md-offset-4">
<div class="alert alert-danger text-center"><?php echo $config->get('messages.error'); ?></div>
</div>
<?php endif; ?>
<form id="contact-form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" enctype="application/x-www-form-urlencoded" class="leave-comment" method="POST">
<h4 class="m-text26 p-b-36 p-t-15">
Send us your message
</h4>
<div class="bo4 of-hidden size15 m-b-20">
<input class="sizefull s-text7 p-l-22 p-r-22" type="text" name="name" id="name" placeholder="Full Name">
</div>
<div class="bo4 of-hidden size15 m-b-20">
<input class="sizefull s-text7 p-l-22 p-r-22" type="number" name="phone-number" id="phone-number" placeholder="Phone Number">
</div>
<div class="bo4 of-hidden size15 m-b-20">
<input class="sizefull s-text7 p-l-22 p-r-22" type="email" name="email" id="email" placeholder="Email Address">
</div>
<textarea class="dis-block s-text7 size20 bo4 p-l-22 p-r-22 p-t-13 m-b-20" name="message" id="message" placeholder="Message"></textarea>
<div class="w-size25">
<!-- Button -->
<button class="flex-c-m size2 bg1 bo-rad-23 hov1 m-text3 trans-0-4" type="submit">
Send
</button>
</div>
</form>
</div>
</div>
</div>
<?php endif; ?>
</section>
<!-- Footer -->
<footer class="bg6 p-t-45 p-b-43 p-l-45 p-r-45">
<div class="flex-w p-b-40">
<div class="w-size19 p-t-30 p-l-15 p-r-25 respon4">
<h4 class="s-text12 p-b-30">
Products
</h4>
<ul>
<li class="p-b-9">
<a href="product.php" class="s-text7">
Sanitary Pads
</a>
</li>
<!-- <li class="p-b-9">
<a href="personal-hygiene.php" class="s-text7">
Personal Hygiene
</a>
</li>
<li class="p-b-9">
<a href="elderly-care.php" class="s-text7">
Elderly Care
</a>
</li> -->
</ul>
</div>
<div class="w-size19 p-t-30 p-l-15 p-r-15 respon4">
<h4 class="s-text12 p-b-30">
About Maasik
</h4>
<ul>
<li class="p-b-9">
<a href="about.php#our-mission" class="s-text7">
Our Mission
</a>
</li>
<li class="p-b-9">
<a href="about.php#who-we-are" class="s-text7">
Who We Are
</a>
</li>
<li class="p-b-9">
<a href="index.php#about-maasik" class="s-text7">
About Maasik
</a>
</li>
<!-- <li class="p-b-9">
<a href="#" class="s-text7">
FAQs
</a>
</li> -->
</ul>
</div>
<div class="w-size19 p-t-30 p-l-15 p-r-15 respon3">
<h4 class="s-text12 p-b-30">
GET IN TOUCH
</h4>
<div>
<p class="s-text7 w-size27">
Any questions? <br/>Let us know at #237, 2nd Floor, JLPL Industrial Area, Sec-82 Mohali, 140301, India or call us on (+1) 96 716 6879
</p>
<div class="flex-m p-t-30">
<a href="https://www.facebook.com/Maasik-474606726405149/?ref=br_rs" target="_blank" class="fs-20 color1 p-r-20 fa fa-facebook"></a>
<a href="#" class="fs-20 color1 p-r-20 fa fa-instagram" target="_blank"></a>
<!-- <a href="#" class="fs-20 color1 p-r-20 fa fa-youtube-play"></a> -->
<a href="https://www.linkedin.com/company/maasik/" target="_blank" class="fs-20 color1 p-r-20 fa fa-linkedin"></a>
</div>
</div>
</div>
<!-- <div class="w-size8 p-t-30 p-l-15 p-r-15 respon3">
<h4 class="s-text12 p-b-30">
Newsletter
</h4>
<form>
<div class="effect1 w-size9">
<input class="s-text7 bg6 w-full p-b-5" type="text" name="email" placeholder="email@example.com">
<span class="effect1-line"></span>
</div>
<div class="w-size2 p-t-20">
<!-- Button -->
<!--<button class="flex-c-m size2 bg4 bo-rad-23 hov1 m-text3 trans-0-4">
Subscribe
</button>
</div>
</form>
</div> -->
</div>
<div class="t-center p-l-15 p-r-15">
<div class="t-center s-text8 p-t-20" style="color:#000000;">
Copyright ©
<script>
document.write(new Date().getFullYear());
</script>. All rights reserved. | Made with <i class="fa fa-heart" style="color:red;" aria-hidden="true"></i> by <a href="http://terxlabs.in" style="color:#000000;" target="_blank">TerxLabs</a>
</div>
</div>
</footer>
<!-- Back to top -->
<div class="btn-back-to-top bg0-hov" id="myBtn">
<span class="symbol-btn-back-to-top">
<i class="fa fa-angle-double-up" aria-hidden="true"></i>
</span>
</div>
<!-- Container Selection -->
<div id="dropDownSelect1"></div>
<div id="dropDownSelect2"></div>
<!--===============================================================================================-->
<script type="text/javascript" src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script type="text/javascript" src="vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
<script type="text/javascript" src="vendor/bootstrap/js/popper.js"></script>
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script type="text/javascript" src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKFWBqlKAGCeS1rMVoaNlwyayu0e0YRes"></script>
<script src="js/map-custom.js"></script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>