帮助!我是初学者(请表示怜悯),使用模板,网站上的一切都很棒......除了联系页面。这封电子邮件不仅不会被发送,而且还会被定向到一个空白的contact.html页面。任何帮助将不胜感激。
这是contact.html
<?php
$name_of_your_site = "longislandsystems.com";
$email_adress_reciever = "joeg@longislandsystems.com";
if(isset($_POST['Send']))
{
include('send.php');
}
?>
<!doctype html>
<!--[if IE 7 ]> <html lang="en-gb" class="isie ie7 oldie no-js"> <![endif]-->
<!--[if IE 8 ]> <html lang="en-gb" class="isie ie8 oldie no-js"> <![endif]-->
<!--[if IE 9 ]> <html lang="en-gb" class="isie ie9 no-js"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-gb" class="no-js"> <!--<![endif]-->
<head>
<title>Long Island Systems - Technical Support & Services for Small Business</title>
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico">
<!-- this styles only adds some repairs on idevices -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Google fonts - witch you want to use - (rest you can just remove) -->
<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Open+Sans:400,800,700italic,700,600italic,600,400italic,300italic,300|Roboto:100,300,400,500,700&subset=latin,latin-ext' type='text/css' />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- ######### CSS STYLES ######### -->
<link rel="stylesheet" href="css/reset.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css">
<!-- responsive devices styles -->
<link rel="stylesheet" media="screen" href="css/responsive-leyouts.css" type="text/css" />
<!-- just remove the below comments witch color skin you want to use -->
<link rel="stylesheet" href="css/colors/lightblue.css" />
<!--<link rel="stylesheet" href="css/colors/lightgreen.css" />-->
<!--<link rel="stylesheet" href="css/colors/blue.css" />-->
<!--<link rel="stylesheet" href="css/colors/green.css" />-->
<!--<link rel="stylesheet" href="css/colors/red.css" />-->
<!--<link rel="stylesheet" href="css/colors/cyan.css" />-->
<!--<link rel="stylesheet" href="css/colors/purple.css" />-->
<!--<link rel="stylesheet" href="css/colors/pink.css" />-->
<!--<link rel="stylesheet" href="css/colors/brown.css" />-->
<!-- just remove the below comments witch bg patterns you want to use -->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-default.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-one.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-two.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-three.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-four.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-five.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-six.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-seven.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-eight.css" />-->
<!--<link rel="stylesheet" href="css/bg-patterns/pattern-nine.css" />-->
<!-- sticky menu -->
<link rel="stylesheet" href="js/sticky-menu/core.css">
</head>
<body>
<div class="wrapper_boxed">
<div class="site_wrapper">
<div class="top_section">
<div class="container">
<ul>
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-google-plus"></i></a></li>
<li><a href="#"><i class="fa fa-linkedin"></i></a></li>
<li><a href="#"><i class="fa fa-rss"></i></a></li>
<li> </li>
<!--<li><a href="#">Live Chat <i class="fa fa-comment"></i></a></li>-->
<li> </li>
<li>Call Today: <strong>(631) 580-2498</strong></li>
</ul>
</div>
</div><!-- end top links -->
<!-- HEADER -->
<header id="header">
<!-- Top header bar -->
<div id="trueHeader">
<div class="wrapper">
<div class="container">
<!-- Logo -->
<div class="one_half"><a href="index.html" id="logo"></a></div>
<!-- Menu -->
<div class="two_half last">
<nav id="access" class="access" role="navigation">
<div id="menu" class="menu">
<ul id="tiny">
<li><a href="index.html">Home</a></li>
<!--<li><a href="standard-hosting.html">Web Hosting<i class="fa fa-angle-down"></i></a>
<ul>
<li><a href="standard-hosting.html">Standard Hosting</a></li>
<li><a href="professional-hosting.html">Professional Hosting</a></li>
<li><a href="advanced-hosting.html">Advanced Hosting</a></li>
<li><a href="unlimited-hosting.html">Unlimited Hosting</a></li>
</ul>
</li>-->
<li><a>Features<i class="fa fa-angle-down"></i></a>
<ul>
<li><a href="standard-page.html">Standard/About Page</a></li>
<li><a href="about-page.html">About Page Style 2</a></li>
<li><a href="typography.html">Typography</a></li>
<li><a href="elements.html">Elements</a></li>
<li><a href="pricing-tables.html">Pricing Tables</a></li>
<li><a href="columns.html">Page Columns</a></li>
<li><a href="testimonials.html">Testimonials</a></li>
<li><a href="faqs.html">FAQs</a></li>
<li><a href="tabs.html">Tabs</a></li>
<li><a href="#">Portfolio Pages ></a>
<ul>
<li><a href="portfolio-one.html">Single Image</a></li>
<li><a href="portfolio-two.html">2 Columns</a></li>
<li><a href="portfolio-three.html">3 Columns</a></li>
<li><a href="portfolio-four.html">4 Columns</a></li>
<li><a href="portfolio-five.html">Portfolio Fancy</a></li>
</ul>
</li>
<li><a href="full-width.html">Full Width Page</a></li>
<li><a href="left-sidebar.html">Left Sidebar Page</a></li>
<li><a href="right-sidebar.html">Right Sidebar Page</a></li>
<li><a href="left-nav.html">Left Navigation</a></li>
<li><a href="right-nav.html">Right Navigation</a></li>
<li><a href="404.html">404 Error Page</a></li>
</ul>
</li>
<li><a>Services<i class="fa fa-angle-down"></i></a>
<ul>
<li><a href="techsupport.html">On Site Tech Support</a></li>
<li><a href="cloud.html">Cloud Computing Services</a></li>
<li><a href="additionaltechsupport.html">Additional Tech Services</a></li>
</ul>
</li>
<!--<li><a href="blog.html">Blog<i class="fa fa-angle-down"></i></a>
<ul>
<li><a href="blog.html">with Large image</a></li>
<li><a href="blog-2.html">with Small image</a></li>
<li><a href="blog-post.html">Single post</a></li>
</ul>
</li>-->
<li><a>Support<i class="fa fa-angle-down"></i></a>
<ul>
<li><a href="cio.html">CIO</a></li>
<li><a href="support-pkg.html">Support Packages</a></li>
<li><a href="vendor_support.html">Vendor Support</a></li>
<li><a href="downloads.html">Popular Downloads</a></li>
</ul>
</li>
<li><a href="about.html">About Us</a></li>
</li>
<li><a href="contact.html" class="active">Contact</a></li>
</ul>
</div>
</nav><!-- end nav menu -->
</div>
</div>
</div>
</div>
</header><!-- end header -->
<div class="clearfix"></div>
<div class="page_title">
<div class="container">
<div class="title"><h1>Our Contact Information</h1></div>
<div class="pagenation"> <a href="index.html">Home</a> <i>/</i> Contact</div>
</div>
</div><!-- end page title -->
<div class="clearfix"></div>
<!-- Contant
======================================= -->
<div class="container">
<div class="content_fullwidth">
<div class="one_half">
<p><strong>General Phone Inquiries: 1-631-580-2498</strong></p>
<br />
<p>We would welcome the opportunity to discuss your needs in more detail and how our services can help make your technology work better for you. If you fill out and submit the form below, we will get back in touch with you as soon as possible to schedule a call or a visit.</p>
<br />
<h3><i>Contact Form</i></h3>
<form action="" method="post">
<fieldset>
<?php if (!isset($errorC) || $errorC == true){ ?>
<label for="name" class="blocklabel">Your Name*</label>
<p class="<?php if (isset($the_nameclass)) echo $the_nameclass; ?>" ><input name="yourname" class="input_bg" type="text" id="name" value=''/></p>
<label for="email" class="blocklabel">E-Mail*</label>
<p class="<?php if (isset($the_emailclass)) echo $the_emailclass; ?>" ><input name="email" class="input_bg" type="text" id="email" value='' /></p>
<label for="website" class="blocklabel">Website</label>
<p><input name="website" class="input_bg" type="text" id="website" value=''/></p>
<label for="message" class="blocklabel">Your Message*</label>
<p class="<?php if (isset($the_messageclass)) echo $the_messageclass; ?>"><textarea name="message" class="textarea_bg" id="message" cols="20" rows="7" ></textarea></p>
<p>
<input type="hidden" id="myemail" name="myemail" value="<?php echo $email_adress_reciever; ?>" />
<input type="hidden" id="myblogname" name="myblogname" value="<?php echo $name_of_your_site; ?>" />
<div class="clearfix"></div>
<input name="Send" type="submit" value="SUBMIT" class="comment_submit" id="send"/></p>
<?php } else { ?>
<!--<div class="success">
<div class="message-box-wrap">
Your message has been <strong>Received Successfully!</strong> Thank you!</div>
</div>-->
<?php } ?>
</fieldset>
</form>
</div>
<div class="one_half last">
<div class="address-info">
<h3><i>Address Info</i></h3>
<ul>
<li>
<strong>Long Island Systems, Inc.</strong><br />
32 Eklund Blvd, Nesconset, NY 11767-3115<br />
Telephone: (631) 580-2498<br />
 <br />
E-mail: <a href="mailto:sales@longislandsystems.com">sales@longislandsystems.com</a><br />
Website: <a href="index.html">www.longislandsystems.com</a>
</li>
</ul>
</div>
<h3><i>Centrally Located on Long Island</i></h3>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d386403.96856923023!2d-73.14851651033781!3d40.83277367166092!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89e839c43ce7228b%3A0xbc88e0b9a21b180e!2sNesconset%2C+NY!5e0!3m2!1sen!2sus!4v1421558373506" width="600" height="450" frameborder="0" style="border:0"></iframe><br />
<!--<small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=WA,+United+States&aq=0&oq=WA&sll=47.605288,-122.329296&sspn=0.008999,0.016544&ie=UTF8&hq=&hnear=Washington,+District+of+Columbia&t=m&z=7&iwloc=A">View Larger Map</a></small>-->
</div>
</div>
</div><!-- end content area -->
<div class="bottom_section">
<div class="waves_graph2"></div>
<div class="big_text2">
<div class="container"><i>Technical Support & Services for Small Business!</i></div>
</div>
</div><!-- end bottom section -->
<div class="footer">
<div class="clearfix mar_top5"></div>
<div class="container">
<div class="one_third">
<h3>Stuff from Us</h3>
<ul class="recent_blogs">
<li>
<img src="images/wand.png" height="50" width="50" alt="" />
<p><a href="tips-tricks.html">Tips and Tricks</a>
<i>January 15, 2015<br />
</i></p>
</li>
<li class="last">
<img src="images/cashregister.png" height="50" width="50" alt="" />
<p><a href="items-for-sale.html">Items for Sale</a>
<i>January 15, 2015      <br />
</i></p>
</li>
</ul>
</div><!-- end section -->
<div class="one_third">
<h3>Other Resources</h3>
<ul class="recent_blogs">
<li>
<img src="images/downarrow.png" height="50" width="50" alt="" />
<p><a href="downloads.html">Popular Downloads</a>
<i>October 19, 2014<br />
</i></p>
</li>
<li class="last">
<img src="images/vetsalute.png" height="50" width="50" alt="" />
<p><a href="supportvets.html">Support our Vets</a>
<i>September 25, 2014<br />
</i></p>
</li>
</ul>
</div><!-- end section -->
<div class="one_third last">
<h3>Have any Questions</h3>
<div class="any_questions">
<img src="images/landline.png" alt="" />
<p>Have any questions?</p>Feel free to call us!</p>
<div class="clearfix mar_top1"></div>
<h3><i>Our Office:</i> 1-631-580-2498</h3>
</div>
</div><!-- end section -->
</div>
<div class="footer_sectwo">
<div class="container">
<!-- end free script installs -->
<!-- end payments accept -->
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="copyright_info">
<div class="container">
<div class="one_half">
<b>Copyright © 2015 Long Island Systems, Inc. All rights reserved. | <a href="privacy.html">Privacy Policy</a></b>
</div>
<div class="one_half last">
<img src="images/logo white.png" align="right" width="150" height="60" padding="20px" />
</div>
</div>
</div>
<div class="clearfix"></div>
<!-- Footer
======================================= -->
<a href="#" class="scrollup">Scroll</a><!-- end scroll to top of the page-->
</div>
</div>
<!-- ######### JS FILES ######### -->
<!-- get jQuery from the google apis -->
<script type="text/javascript" src="js/universal/jquery.js"></script>
<!-- style switcher -->
<script src="js/style-switcher/jquery-1.js"></script>
<script src="js/style-switcher/styleselector.js"></script>
<!-- main menu -->
<script type="text/javascript" src="js/mainmenu/ddsmoothmenu.js"></script>
<script type="text/javascript" src="js/mainmenu/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/mainmenu/selectnav.js"></script>
<script type="text/javascript" src="js/mainmenu/scripts.js"></script>
<!-- scroll up -->
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 500);
return false;
});
});
</script>
<script type="text/javascript" src="js/sticky-menu/core.js"></script>
</body>
</html>
这是send.php
<?php
if(isset($_POST['Send']) || isset($_POST['ajax'])){
$errorC = false;
$the_name = $_POST['yourname'];
$the_email = $_POST['email'];
$the_website = $_POST['website'];
$the_message = $_POST['message'];
$the_url = $_POST['imageURL'];
$the_subject = $_POST['Subject'];
# want to add aditional fields? just add them to the form in template_contact.php,
# you dont have to edit this file
//added fields that are not set explicit like the once above are combined and added before the actual message
$already_used = array('yourname','email','website','message','ajax','myemail','myblogname','Send','Subject','imageURL');
$attach = '';
foreach ($_POST as $key => $field)
{
if(!in_array($key,$already_used))
{
$attach.= $key.": ".$field."<br /> \n";
}
}
$attach.= "<br /> \n";
if(!checkmymail($the_email))
{
$errorC = true;
$the_emailclass = "error";
}else{
$the_emailclass = "valid";
}
if($the_name == "")
{
$errorC = true;
$the_nameclass = "error";
}else{
$the_nameclass = "valid";
}
if($the_message == "")
{
$errorC = true;
$the_messageclass = "error";
}else{
$the_messageclass = "valid";
}
if($the_subject != '') $the_subject = 'Subject: '.$the_subject."<br/>";
if($the_url != '') $the_url = 'Preview Image: '.$the_url."<br/>";
if($errorC == false)
{
$to = $_POST['myemail'];
$subject = "New Message from " . $_POST['myblogname'];
$header = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$header .= 'From:'. $_POST['email'] . " \r\n";
$message1 = nl2br($_POST['message']);
$message = "New message from $the_name <br/>
Mail: $the_email<br />
Website: $the_website <br />
$the_subject
$the_url
$attach <br />
Message: $message1 <br />";
mail($to,
$subject,
$message,
$header);
if(isset($_POST['ajax'])){
echo"<h3>Your message has been sent!</h3><p> Thank you!</p>";
}
}
}
function checkmymail($mailadresse){
$email_flag=preg_match("!^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$!",$mailadresse);
return $email_flag;
}
?>
此处是指向其当前托管位置的链接
http://www.longislandsystems.com/newweb
非常感谢,提前
答案 0 :(得分:3)
您将PHP代码放在.html文件中。您的contact.html
应重命名为contact.php
。