0
このサイトは、単純な5ページのサイト[1]で、ホームページのフォームとリダイレクトされた「ありがとう」ページです。FireFoxまたはIEでウェブサイトが開かれていません
ChromeとSafariで開いて動作しますが、FirefoxとIEでは動作しません。それは "ありがとう" HTMLとPHPが削除されて動作しますが。
コードはW3C Schoolsの例に由来しています。 クイックフィックスはありますか?
ご意見ありがとうございます。 w3c学校へのリンクはenter link description hereです。.htaccessファイルには引用符以外のものはありません。私の編集したコードはここにある:ループ あり
<?php
if(isset($_POST["name"])) {
$body = "Name : " . $_POST['name'] . "\n\rEmail : " . $_POST['email'] . "\n\rComment : " . $_POST['comment'] ;
mail("[email protected]", "Form to email message", $body, "From: [email protected]");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="john leftwich, cool illustration, ideas, illustration, artwork, technical, cartoons, brackley, england, unique"/>
<meta name="description" content="Worked in the graphic arts field for ever and am happy to work free of charge for non profit-making and charitable organisations, and 'mates' of course"/>
<title>John Leftwich</title>
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Rock Salt">
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript" src="script.js">
</script>
</head>
<body>
<div id="newfont">John Leftwich</div>
<p></p>
<!--navbar-->
<ul id="nav">
\t <div id="anothernewfont">
\t <li class="currentpage">HOME</li>
\t <li><a href="sketching.html">SKETCH BOOK</a></li>
<li><a href="technical.html">TECHNICAL</a></li>
<li style="white-space:nowrap"><a href="life.html">LIFE DRAWING</a></li>
\t <li><a href="#">COVERS</a></li>
\t </div>
</ul>
<!--</div><!--END navbar-->
<p> Click for larger images . . .</p>
<!--top page images-->
<div class="row">
<div class="column">
<img src="images/busart.jpg" style="width:100%" onclick="openModal();currentSlide(1)" class="hover-shadow cursor">
\t <img src="images/reception1.jpg" style="width:100%" onclick="openModal();currentSlide(5)" class="hover-shadow cursor">
</div>
<div class="column">
<img src="images/cartoon1.jpg" style="width:100%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
\t <img src="images/witney.jpg" style="width:100%" onclick="openModal();currentSlide(6)" class="hover-shadow cursor">
</div>
<div class="column">
<img src="images/latojg.jpg" style="width:100%" onclick="openModal();currentSlide(3)" class="hover-shadow cursor">
\t <img src="images/map1.jpg" style="width:100%" onclick="openModal();currentSlide(7)" class="hover-shadow cursor">
</div>
<div class="column">
<img src="images/lockgates.jpg" style="width:100%" onclick="openModal();currentSlide(4)" class="hover-shadow cursor">
\t <img src="images/cuttings.jpg" style="width:100%" onclick="openModal();currentSlide(8)" class="hover-shadow cursor">
</div>
</div>
<!--END of top page images-->
<div id="textpara">
<p style="line-height:1.4em">I have spent my working life in the graphic arts field and am happy to work free of charge for non profit-making and charitable organisations, and 'mates' of course! Please use the form below to contact me.</p>
</div>
<?php
// define variables and set to empty values
$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["email"])) {
$emailErr = "Email is required";
} else {
$email = test_input($_POST["email"]);
// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}
if (empty($_POST["comment"])) {
$comment = "";
} else {
$comment = test_input($_POST["comment"]);
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
header("Location: {$_POST["redirect"]}");
?>
<!--START form-->
<div style="width:320px; margin:auto">
<form method="post" enctype="multipart/form-data" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<br>
<p>Name:<br>
<input style="background-color:#f2f2f2" type="text" name="name" size="48" value="">
</p>
<p>Your email address here:<br>
<input style="background-color:#f2f2f2" type="email" name="email" size="48" value="" >
</p>
<p>Comment:<br>
<textarea style="background-color:#f2f2f2" name="comment" rows="5" cols="37"> </textarea>
</p>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset"></p>
<!--extra bit added-->
<input type="hidden" name="redirect" value="http://www.johnleftwich.co.uk/thank_you_page.html">
<!--extra bit ends-->
</form>
</div>
<!--END form-->
<!--START footer-->
<div style="width:96%;margin-top:30px; border-bottom:1px solid #000099">
<div style="float:left"><p style="line-height:0em">Site host: <a class="text" href="http://www.selectinternet.co.uk">Select Internet</a><br></div>
<div style="float:right; text-align:right"><p style="line-height:0em">January 2017<br></div>
<div style="clear:both"></div>
</div>
<!--END footer-->
<!--START lightbox-->
<div id="myModal" class="modal">
<div class="modal-content">
\t <span class="close" onclick="closeModal()"><img src="images/button.png "/></span>
\t
\t <img class="next" onclick="plusSlides(1)" src="images/arrownext.png" />
\t <img class="prev" onclick="plusSlides(-1)" src="images/arrowprev.png" />
\t
<div class="mySlides">
<div class="numbertext">1/8</div>
<img src="images/busart_wide.jpg" style="width:100%">
</div>
<div class="mySlides">
<div class="numbertext">2/8</div>
<img src="images/cartoon1_wide.jpg" style="width:100%">
</div>
<div class="mySlides">
<div class="numbertext">3/8</div>
<img src="images/latojg_wide.jpg" style="width:100%">
</div>
<div class="mySlides">
<div class="numbertext">4/8</div>
<img src="images/lockgates_wide.jpg" style="width:100%">
</div>
\t
\t <div class="mySlides">
<div class="numbertext">5/8</div>
<img src="images/reception1_wide.jpg" style="width:100%">
</div>
\t
\t <div class="mySlides">
<div class="numbertext">6/8</div>
<img src="images/witney_wide.jpg" style="width:100%">
</div>
\t
\t <div class="mySlides">
<div class="numbertext">7/8</div>
<img src="images/map1_wide.jpg" style="width:100%">
</div>
\t
\t <div class="mySlides">
<div class="numbertext">8/8</div>
<img src="images/cuttings_wide.jpg" style="width:100%">
</div>
<div class="caption-container">
<p id="caption"></p>
</div>
<div class="columnlower">
<img class="demo cursor" src="images/busart.jpg" style="width:100%" onclick="currentSlide(1)" alt="Disaster Management Course brochure illustration">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/cartoon1.jpg" style="width:100%" onclick="currentSlide(2)" alt="Bankers' "loadsamoneyland" and Dave Cameron">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/latojg.jpg" style="width:100%" onclick="currentSlide(3)" alt="Cover illustration for Land's End to J O'Groats Walk book">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/lockgates.jpg" style="width:100%" onclick="currentSlide(4)" alt="Canal lock gates sketch">
</div>
\t
\t <div class="columnlower">
<img class="demo cursor" src="images/reception1.jpg" style="width:100%" onclick="currentSlide(5)" alt="Business reception area">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/witney.jpg" style="width:100%" onclick="currentSlide(6)" alt="Witney tennis club logo">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/map1.jpg" style="width:100%" onclick="currentSlide(7)" alt="Map for Murder for thr Truth book">
</div>
<div class="columnlower">
<img class="demo cursor" src="images/cuttings.jpg" style="width:100%" onclick="currentSlide(8)" alt="Newspaper cuttings">
</div>
</div>
</div>
</body>
</html>
サイトが302リダイレクトループでスタックしているようです。私たちにいくつかのコードを教えてくれますか? – danjam
これ以上の情報を提供できますか? .htaccessファイルに他の行がありますか? W3Cの例にリンクできますか? –