Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP和HTML:我做错了什么?_Php_Html_Css - Fatal编程技术网

PHP和HTML:我做错了什么?

PHP和HTML:我做错了什么?,php,html,css,Php,Html,Css,我已经看了好几个小时了,但我不记得如何使我的HTML和CSS显示在PHP输出中。我错过什么了吗?我在第78行收到一个错误代码,或者代码回音为“”;开始。任何额外的眼睛将不胜感激 <?php if(isset($_POST['email'])) { // CHANGE THE TWO LINES BELOW $email_to = "kavik_609@hotmail.com"; $email_subject = "website html form submissions"; fu

我已经看了好几个小时了,但我不记得如何使我的HTML和CSS显示在PHP输出中。我错过什么了吗?我在第78行收到一个错误代码,或者代码回音为“”;开始。任何额外的眼睛将不胜感激

<?php
if(isset($_POST['email'])) {

// CHANGE THE TWO LINES BELOW
$email_to = "kavik_609@hotmail.com";

$email_subject = "website html form submissions";


function died($error) {
    // your error code can go here
    echo "We are very sorry, but there were error(s) found with the form you submitted. ";
    echo "These errors appear below.<br /><br />";
    echo $error."<br /><br />";
    echo "Please go back and fix these errors.<br /><br />";
    die();
}

// validation expected data exists
if(!isset($_POST['first_name']) ||
    !isset($_POST['last_name']) ||
    !isset($_POST['email']) ||
    !isset($_POST['telephone']) ||
    !isset($_POST['comments'])) {
    died('We are sorry, but there appears to be a problem with the form you submitted.');       
}

$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required

$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}

$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";


// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  


print "<!doctype html>";
print "<html>";
print "<head>";
print "<meta charset="UTF-8">";
print "<title>This & That Unique Designs by Megan Gifford</title>";
print "<meta name="keywords" content="Mecosta County, Big Rapids, Unique, Design, Custom Creations, Florist, Megan Gifford">";
print "<meta name="description" content="This & That: Unique Designs by Megan Gifford">";
print "<link href="thisthat.css" rel="stylesheet" type="text/css">";
print "</head>";

print "<body>";


print "<div id="page">";

print "<img src="images/slideshow/image_7.jpg" width="235" height="992" alt="Second Image" />";




print "<div class="content">";

print "<div class="header">";
print "<img src="logo/header.png" alt="Header">";
print "</div>";






print "<div class="horizontal">";
print "<ul id="nav-bar">";
print "<li class="links"><a href="index.html">Home</a></li>";

print "<li class="links"><a href="#">Events</a>";
print "<ul class="linkshover">";
print "<li class="linkshover"><a href="#">Weddings</a></li>";
print "<li class="linkshover"><a href="#">Funerals</a></li>";
print "<li class="linkshover"><a href="#">Family Gatherings</a></li>";
print "<li class="linkshover"><a href="#">Celebrations</a></li>";
print "<li class="linkshover"><a href="#">Interior Design</a></li>";
print "</ul></li>

print "<li class="links"><a href="#">Gallery</a>";
print "<ul class="linkshover">";
print "<li class="linkshover"><a href="#">Weddings</a></li>";
print "<li class="linkshover"><a href="#">Repurpose Projects</a></li>";
print "<li class="linkshover"><a href="wreaths.html">Custom Wreaths</a></li>";
print "<li class="linkshover"><a href="#">Everyday Flowers</a></li>";
print "<li class="linkshover"><a href="#">Interior Design</a></li>";
print "<li class="linkshover"><a href="#">Head Pieces</a></li>";
print "<li class="linkshover"><a href="#">Odds & Ends</a></li>";
print "</ul></li>";

print "<li class="links"><a href="bloghome.html">Blog</a>";
print "<ul class="linkshover">";
print "<li class="linkshover"><a href="#">Link</a></li>";
print "</ul></li>";

print "<li class="links"><a href="#">Contact</a></li>";

print "</ul>";
print "</div>";

print "<p>Thank you for contacting us. We will be in touch with you very soon.</p>";

print "<div class="footer">";

print "<div id="social">";
print "<a href="https://www.facebook.com/pages/This-That-Unique-Designs-by-Megan-Gifford/978137455546948" target="_blank"><img src="logo/facebook.png" alt="Facebook"></a>";
print "<a href="https://twitter.com/wendyamstar" target="_blank"><img src="logo/pinterest.png" alt="Pinterest"></a>";
print "<a href="http://www.panduvie.com/wendyamstar" target="_blank"><img src="logo/instagram.png" alt="Instagram"></a>";
print "</div>";

print "<img src="logo/footer.png" alt="Footer">";

print "</div>";

print "</div>";


print "</div>";





print "</body>";
print "</html>";
?>

<?php
}
die();
?>

您对
约定有问题

将不允许另一个
进入它的边界,直到您退出它

您可以在
内部使用
或者在
内部使用

或者你可以这样逃避

print "<meta charset=\"UTF-8\">";
print”“;

错误报告应该会给您带来很多提示