<?php
if($_POST)
{
$to_Email = "myemail@gmail.com"; //Replace with recipient email address
$subject = 'Ah!! My email from Somebody out there...'; //Subject line for emails
//check if its an ajax request, exit if not
if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
//exit script outputting json data
$output = json_encode(
array(
'type'=>'error',
'text' => 'Request must come from Ajax'
));
die($output);
}
//check $_POST vars are set, exit if any missing
if(!isset($_POST["userName"]) || !isset($_POST["userEmail"]) || !isset($_POST["userPhone"]) || !isset($_POST["userMessage"]))
{
$output = json_encode(array('type'=>'error', 'text' => 'Input fields are empty!'));
die($output);
}
//Sanitize input data using PHP filter_var().
$user_Name = filter_var($_POST["userName"], FILTER_SANITIZE_STRING);
$user_Email = filter_var($_POST["userEmail"], FILTER_SANITIZE_EMAIL);
$user_Phone = filter_var($_POST["userPhone"], FILTER_SANITIZE_STRING);
$user_Message = filter_var($_POST["userMessage"], FILTER_SANITIZE_STRING);
//additional php validation
if(strlen($user_Name)<4) // If length is less than 4 it will throw an HTTP error.
{
$output = json_encode(array('type'=>'error', 'text' => 'Name is too short or empty!'));
die($output);
}
if(!filter_var($user_Email, FILTER_VALIDATE_EMAIL)) //email validation
{
$output = json_encode(array('type'=>'error', 'text' => 'Please enter a valid email!'));
die($output);
}
if(!is_numeric($user_Phone)) //check entered data is numbers
{
$output = json_encode(array('type'=>'error', 'text' => 'Only numbers allowed in phone field'));
die($output);
}
if(strlen($user_Message)<5) //check emtpy message
{
$output = json_encode(array('type'=>'error', 'text' => 'Too short message! Please enter something.'));
die($output);
}
//proceed with PHP email.
/*
Incase your host only allows emails from local domain,
you should un-comment the first line below, and remove the second header line.
Of-course you need to enter your own email address here, which exists in your cp.
*/
//$headers = 'From: your-name@YOUR-DOMAIN.COM' . "\r\n" .
$headers = 'From: '.$user_Email.'' . "\r\n" . //remove this line if line above this is un-commented
'Reply-To: '.$user_Email.'' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// send mail
$sentMail = @mail($to_Email, $subject, $user_Message .' -'.$user_Name, $headers);
if(!$sentMail)
{
$output = json_encode(array('type'=>'error', 'text' => 'Could not send mail! Please check your PHP mail configuration.'));
die($output);
}else{
$output = json_encode(array('type'=>'message', 'text' => 'Hi '.$user_Name .' Thank you for your email'));
die($output);
}
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
企业网站HTML源码-创意产品定价展示响应式网页模板-可适配移动端.zip
共59个文件
jpg:31个
js:14个
css:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 25 浏览量
2024-03-25
08:42:20
上传
评论
收藏 3.62MB ZIP 举报
温馨提示
打造企业级网站,源码在手,天下我有! 移动端完美适配 — 在这个以手机为王的时代,我们的HTML源码专为移动设备优化,确保你的企业网站无论在大屏还是小屏上都能流畅展现,抓住移动互联网的巨量流量。 专业企业设计 — 每行代码都经过精心设计与优化,兼顾美观与性能。让你的网站不仅拥有专业的外观,还能提供快速的加载速度和优秀的用户体验。 高度可定制 — 这份源码易于修改和扩展,让你随心所欲地定制功能和样式,无需担心技术难题。 SEO优化结构 — 良好的SEO结构让你的网站更容易被搜索引擎发现,提升品牌曝光度,带来更多潜在客户。 作为一名程序员,时间就是金钱,效率就是生命。合理利用模板,让你的项目开发事半功倍,立刻启动你的互联网成功之旅!你将节省无数宝贵时间和避免潜在的开发坑洞,快速部署一个高效、吸引人且响应式的企业网站。现在行动,让你的业务在数字世界中翱翔!
资源推荐
资源详情
资源评论
收起资源包目录
企业网站HTML源码-创意产品定价展示响应式网页模板-可适配移动端.zip (59个子文件)
企业网站HTML源码-创意产品定价展示响应式网页模板-可适配移动端
html
style.css 22KB
js
imagesloaded.pkgd.min.js 7KB
modernizr.custom.79639.js 9KB
wow.js 13KB
bootstrap.min.js 31KB
jquery.easing.min.js 5KB
main.js 8KB
jquery.nicescroll.js 122KB
jquery.ba-cond.min.js 532B
scrollupto.js 2KB
jquery.isotope.js 44KB
owl.carousel.js 52KB
jquery.mixitup.min.js 14KB
jquery.slitslider.js 16KB
skillset.js 3KB
contact_me.php 3KB
img
2.jpg 28KB
header_bg.jpg 665KB
ui.totop.png 4KB
tm1.png 14KB
photo-01.jpg 528KB
1.jpg 35KB
photo-03.jpg 486KB
portfolios
card
2.jpg 48KB
1.jpg 76KB
5.jpg 57KB
3.jpg 38KB
4.jpg 33KB
app
2.jpg 31KB
1.jpg 93KB
3.jpg 56KB
web
2.jpg 46KB
1.jpg 48KB
3.jpg 36KB
4.jpg 33KB
logo
2.jpg 12KB
6.jpg 59KB
1.jpg 13KB
5.jpg 9KB
3.jpg 12KB
7.jpg 19KB
4.jpg 70KB
icon
2.jpg 67KB
1.jpg 41KB
5.jpg 53KB
3.jpg 105KB
4.jpg 37KB
photo-02.jpg 688KB
preloader.gif 18KB
3.jpg 56KB
photography.png 1005B
geometry2.png 2KB
css
bootstrap.min.css 107KB
owl.carousel.css 1KB
owl.transitions.css 4KB
animate.css 56KB
skillset.css 3KB
owl.theme.css 2KB
index.html 40KB
共 59 条
- 1
资源评论
DTcode7
- 粉丝: 6986
- 资源: 4493
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功