<?php
if (isset($_REQUEST['action'])) {
if ($_REQUEST['action'] == "contact_form_request") {
$ourMail = "[email protected]";
$required_fields = array("name", "email", "message");
$pre_messagebody_info = "";
$errors = array();
$data = array();
parse_str($_REQUEST['values'], $data);
//check for required and assemble message
if (!empty($data)) {
foreach ($data as $key => $value) {
$name = strtolower(trim($key));
if (in_array($name, $required_fields)) {
if (empty($value)) {
$errors[$name] = "Enter please " . $name . " right!";
}
}
if ($name == "email") {
if (!isValidEmail($value)) {
$errors[$name] = "Enter please " . $name . " right!";
}
}
}
}
//***
session_start();
$verify = $_SESSION['verify'];
if ($verify != md5($data['verify'])) {
$errors["verify"] = "Capcha";
}
//***
$result = array(
"is_errors" => 0,
"info" => ""
);
if (!empty($errors)) {
$result['is_errors'] = 1;
$result['info'] = $errors;
echo json_encode($result);
exit;
}
$pre_messagebody_info.="<strong>Name</strong>" . ": " . $data['name'] . "<br />";
$pre_messagebody_info.="<strong>E-mail</strong>" . ": " . $data['email'] . "<br />";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers.= "From: ".$data['email']."\r\n";
$after_message = "\r\n<br />--------------------------------------------------------------------------------------------------\r\n<br /> This mail was sent via contact form";
if (mail($ourMail, "Email from contact form", $pre_messagebody_info .="<strong>Message</strong>" . ": " . nl2br($data['message']) .$after_message, $headers)) {
$result["info"] = "success";
} else {
$result["info"] = "server_fail";
}
echo json_encode($result);
exit;
}
}
function isValidEmail($email){
return filter_var($email, FILTER_VALIDATE_EMAIL);
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
蓝色大图幻灯宗教信仰html5整站模板_html5 bootstrap 响应式模板UI前端源码.rar
共211个文件
png:76个
jpg:67个
html:30个
0 下载量 54 浏览量
2023-08-01
14:02:22
上传
评论
收藏 8.29MB RAR 举报
温馨提示
蓝色大图幻灯宗教信仰html5整站模板_html5 bootstrap 响应式模板UI前端源码.rar
资源推荐
资源详情
资源评论
收起资源包目录
蓝色大图幻灯宗教信仰html5整站模板_html5 bootstrap 响应式模板UI前端源码.rar (211个子文件)
style.css 104KB
mediaelementplayer.css 19KB
settings.css 13KB
skeleton.css 10KB
fancybox.min.css 5KB
jquery.fancybox.css 3KB
jquery.fancybox-buttons.css 2KB
jquery.fancybox-thumbs.css 719B
loading.gif 6KB
fancybox_loading.gif 4KB
loader.gif 2KB
preloader.gif 559B
blank.gif 43B
PIE.htc 40KB
typography.html 26KB
blog.html 23KB
index.html 23KB
features-tabs.html 22KB
blog-single.html 22KB
portfolio-mixed.html 22KB
blog-single-without-image.html 22KB
portfolio-2-columns-with-right-sidebar.html 22KB
portfolio-1-column-with-right-sidebar.html 21KB
portfolio-3-columns-full-width.html 21KB
columns.html 20KB
features-toggle.html 20KB
portfolio-1-column-full-width.html 19KB
gallery-2-columns-with-right-sidebar.html 19KB
gallery-4-columns-full-width.html 18KB
events.html 18KB
single-page-with-right-sidebar.html 18KB
single-page-with-left-sidebar.html 18KB
event-single.html 18KB
event-single-without-image.html 18KB
gallery-mixed.html 17KB
portfolio-2-columns-full-width.html 17KB
gallery-3-columns-full-width.html 17KB
features-buttons.html 17KB
staff.html 17KB
features-testimonials.html 16KB
features-notifications.html 16KB
gallery-2-columns-full-width.html 16KB
single-page-full-width.html 14KB
contacts.html 14KB
01.jpg 1.18MB
12.jpg 805KB
09.jpg 575KB
11.jpg 450KB
10.jpg 366KB
06.jpg 353KB
full-width.jpg 347KB
05.jpg 345KB
03.jpg 255KB
07.jpg 214KB
04.jpg 205KB
slide-3.jpg 169KB
slide-4.jpg 153KB
slide-2.jpg 133KB
02.jpg 117KB
slide-5.jpg 116KB
col1-2.jpg 112KB
08.jpg 108KB
col2-3.jpg 94KB
blog-img-1.jpg 89KB
blog-img-2.jpg 68KB
col1-5.jpg 65KB
col2-1.jpg 64KB
col1-3.jpg 61KB
sample.jpg 61KB
col3-3.jpg 60KB
col1-4.jpg 59KB
blog-img-3.jpg 59KB
col2-4.jpg 57KB
temp-img-1.jpg 56KB
col2-2.jpg 55KB
col1-1.jpg 54KB
col3-9.jpg 51KB
col3-5.jpg 50KB
temp-img-3.jpg 48KB
col3-6.jpg 46KB
temp-img-2.jpg 45KB
men.jpg 44KB
col3-1.jpg 43KB
col4-3.jpg 42KB
col3-4.jpg 39KB
staff-img-1.jpg 39KB
col3-7.jpg 36KB
col3-8.jpg 36KB
col4-9.jpg 35KB
staff-img-2.jpg 34KB
col4-6.jpg 34KB
col4-5.jpg 34KB
col3-2.jpg 33KB
staff-img-3.jpg 33KB
col4-1.jpg 32KB
staff-img-4.jpg 31KB
col4-4.jpg 29KB
col4-7.jpg 28KB
col4-8.jpg 28KB
col4-2.jpg 25KB
共 211 条
- 1
- 2
- 3
资源评论
dunming_6725413
- 粉丝: 16
- 资源: 6951
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功