-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
39 lines (30 loc) · 1.38 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
<?php
include ("include/config.php");
$msg = "";
$smarty->assign('rand1',rand(1, 10));
$smarty->assign('rand2',rand(5, 15));
if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['action']=="submit"){
$data = $_POST['data'];
$name = $data['name'];
$email = $data['email'];
$subject = $data['subject'];
$body = $data['body'];
$from = $email;
$to = '[email protected]';
$subject = 'Contact from TextLink: '.$subject;
$message = '<p>Name: '.$name.'</p>
<p>Email: '.$email.'</p>
<br><br>Content: '.$body;
$headers = 'From: '.$email. "\r\n" .
'Reply-To: '.$to."\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
$smarty->assign('msg_contact', 'Liên hệ của bạn đã được gửi. Cám ơn bạn đã quan tâm đến TextLink.');
}
$meta[title] ='Hãy liên hệ với chúng tôi - Textlink.vn';
$meta[des] ='Nếu bạn gặp bất kỳ vấn đề gì trong quá trình sử dụng Textlink.vn, xin hãy vui lòng liên hệ với chúng tôi qua email hoặc số điện thoại hotline - Mỗi câu hỏi của các bạn là một cơ hội để chúng tôi nâng cao dịch vụ chăm sóc khách hàng!.';
$smarty->assign('meta', $meta);
$content = $smarty->fetch('contact.tpl');
$smarty->assign('content',$content);
$smarty->display('master_page.tpl');
?>