<?php
// Replace this with your own email address
$siteOwnersEmail = 'user@website.com';
if($_POST) {
$name = trim(stripslashes($_POST['contactName']));
$email = trim(stripslashes($_POST['contactEmail']));
$subject = trim(stripslashes($_POST['contactSubject']));
$contact_message = trim(stripslashes($_POST['contactMessage']));
// Check Name
if (strlen($name) < 2) {
$error['name'] = "Please enter your name.";
}
// Check Email
if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $email)) {
$error['email'] = "Please enter a valid email address.";
}
// Check Message
if (strlen($contact_message) < 15) {
$error['message'] = "Please enter your message. It should have at least 15 characters.";
}
// Subject
if ($subject == '') { $subject = "Contact Form Submission"; }
// Set Message
$message .= "Email from: " . $name . "<br />";
$message .= "Email address: " . $email . "<br />";
$message .= "Message: <br />";
$message .= $contact_message;
$message .= "<br /> ----- <br /> This email was sent from your site's contact form. <br />";
// Set From: header
$from = $name . " <" . $email . ">";
// Email Headers
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $email . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (!$error) {
ini_set("sendmail_from", $siteOwnersEmail); // for windows server
$mail = mail($siteOwnersEmail, $subject, $message, $headers);
if ($mail) { echo "OK"; }
else { echo "Something went wrong. Please try again."; }
} # end if - no validation error
else {
$response = (isset($error['name'])) ? $error['name'] . "<br /> \n" : null;
$response .= (isset($error['email'])) ? $error['email'] . "<br /> \n" : null;
$response .= (isset($error['message'])) ? $error['message'] . "<br />" : null;
echo $response;
} # end if - there was a validation error
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
html5模板-.HTML5响应式模版Sparrow.zip (140个子文件)
layout.css 28KB
font-awesome.css 21KB
default.css 19KB
font-awesome.min.css 17KB
media-queries.css 12KB
fonts.css 7KB
fontawesome-webfont.eot 37KB
raleway-regular-webfont.eot 26KB
raleway-light-webfont.eot 26KB
raleway-semibold-webfont.eot 26KB
raleway-bold-webfont.eot 26KB
raleway-extrabold-webfont.eot 26KB
raleway-medium-webfont.eot 26KB
raleway-extralight-webfont.eot 25KB
raleway-heavy-webfont.eot 25KB
raleway-thin-webfont.eot 24KB
notosans-italic-webfont.eot 22KB
notosans-bolditalic-webfont.eot 22KB
notosans-bold-webfont.eot 21KB
notosans-regular-webfont.eot 20KB
loader.gif 5KB
styles.html 23KB
single.html 20KB
index.html 17KB
blog.html 15KB
about.html 14KB
contact.html 12KB
portfolio-index.html 11KB
portfolio.html 9KB
favicon.ico 1KB
geometric-backgrounds-02.jpg 232KB
geometric-backgrounds-01.jpg 211KB
into-the-light.jpg 121KB
camera-man.jpg 100KB
post-image-1300x500-01.jpg 98KB
farmerboy.jpg 95KB
geometrics.jpg 91KB
post-image-1300x500-02.jpg 91KB
console.jpg 88KB
coffee-cup.jpg 81KB
post-image-1300x500-03.jpg 81KB
sample-image.jpg 26KB
team-img-01.jpg 10KB
team-img-02.jpg 9KB
team-img-03.jpg 9KB
works-bg.jpg 5KB
tweets-bg.jpg 5KB
bg.jpg 5KB
header-bg.jpg 4KB
content-bg.jpg 3KB
thumb.jpg 1KB
jquery-1.10.2.min.js 91KB
jquery.flexslider.js 51KB
modernizr.js 15KB
jquery-migrate-1.2.1.min.js 7KB
init.js 3KB
doubletaptogo.js 890B
icons.less 26KB
variables.less 10KB
spinning.less 765B
mixins.less 699B
path.less 684B
stacked.less 476B
font-awesome.less 405B
list.less 375B
larger.less 370B
rotated-flipped.less 367B
bordered-pulled.less 330B
core.less 270B
fixed-width.less 119B
FontAwesome.otf 61KB
sendEmail.php 2KB
home-slider-image-01.png 539KB
home-slider-image-02.png 243KB
logo.png 5KB
author-img.png 3KB
go-to-top.png 3KB
direction-nav-right.png 3KB
direction-nav-left.png 3KB
user-02.png 2KB
user-01.png 2KB
user-03.png 2KB
client-img.png 2KB
overlay.png 932B
search-icon.png 362B
_icons.scss 26KB
_variables.scss 10KB
_spinning.scss 766B
_mixins.scss 701B
_path.scss 695B
_stacked.scss 482B
_rotated-flipped.scss 412B
font-awesome.scss 405B
_list.scss 378B
_larger.scss 375B
_bordered-pulled.scss 332B
_core.scss 271B
_fixed-width.scss 120B
fontawesome-webfont.svg 197KB
raleway-heavy-webfont.svg 142KB
共 140 条
- 1
- 2
资源评论
GJZGRB
- 粉丝: 1075
- 资源: 5911
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功