2012-11-20 5 views
-3

조금 도와 드릴 수 있는지 궁금합니다. 높은 초보자의 모든의유효성 검사 PHP에서 생성 된 HTML 코드

첫째, 임 나 : 너무 하드하지 않도록 코딩 lvl합니다

내 웹 사이트에 코드를 확인하기 위해 노력하고있어 나는 짜증나는 오류 I납니다 없애 버릴 수 없다.

<div id="mainWrapperbackground"> 
    <div id="allContentbackground"> 
     <img src="img/banner.png" alt="banner" id="banner"> 
     <img src="img/left.jpg" alt="leftside" id="left"> 
     <img src="img/right.jpg" alt="rightside" id="right"> 
     <img src="img/nav.png" alt="navigation" id="fullnav"> 
     <img src="img/poleright.png" alt="poleright" id="poleright"> 
     <img src="img/poleleft.png" alt="poleleft" id="poleleft"> 
     <img src="img/footer.jpg" alt="footer" id="footerimg"> 
     <form method="get" action="/search" id="search"> 
      <input name="index.php?page=recipe1" type="text" size="40" placeholder="Search..." > 
     </form> 

     <div id="footer"> 
      <em>Rising Cupcakes | Fairystreet 182st | 4500 Wonderland | Tel. +88 21 45 65</em> 
     </div></div></div> 
<!DOCTYPE html> 
<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
     <link href="styles.css" rel="stylesheet" /> 
     <title>Cupcake Lovers</title> 
    </head> 
    <body> 
     <div id="mainWrapper"> 
      <div id="allContent"> 
       <div id="mainWrapperbackground"> 
        <div id="allContentbackground"> 
         <nav id="global-nav"> 
          <a href="index.php?page=contact"> <img src="img/contactb.png" alt="contactb" id="contactb"></a> <a href="index.php?page=guestbook"><img src="img/guestbookb.png" alt="guestbookb" id="guestbookb"></a> <a href="index.php?page=newsletter"><img src="img/newsletterb.png" alt="newsletterb" id="newsletterb"></a> <a href="index.php?page=history"><img src="img/historyb.png" alt="historyb" id="historyb"></a> <a href="mailto:[email protected]"><img src="img/maillogo.png" alt="maillogo" id="maillogo"></a> <a href="http://www.facebook.com"><img src="img/fblogo.png" alt="facebooklogo" id="fblogo"></a> <a href="index.php?page=home"><img src="img/homeb.png" alt="homeb" id="homeb"></a> <a href="index.php?page=recipegallery"><img src="img/recipesb.png" alt="recipesbutton" id="recipesb"> </a> 
         </nav> 
         <img src ="img/cupcake.png" alt="cupcake" id="cupcake"> 
         <div id="homehead"> 
         <h5>Welcome! 
        </h5> 
       </div> 
       <p class="first">Welcome to <b>"Cupcake Lovers"!</b> 
       <br> 
        <br> 
         We have opened this homepage to introduce you to Celina's 6 most famous cupcake recipes. 
         <br> 
          Celina's recipes follow the principle of being easy to make, beautiful to look at, and delicious to eat! 
          <br> 
           If like Celina, cupcakes are your passion, then go learn about the history of cupcakes or join our 
           <br> 
            newsletter and get updates about what's going on in the world of cupcakes. 
            <br> 
             <br> 
              Don't forget to sign our guestbook! 
              <br> 
               <br> 
                Happy baking, 
                <br> 
                 <em>Celina's cupcakes for Cupcake Lovers</em> 
                 <br> 
                  ----------------------------------------------------------------------------------------------------------------------------- 
                 </p> 
                </div> 
               </div> 
              </body> 
             </html> 

유효성 검사기는 말한다 : 3 호선, 열 1 : 여기 는 소스 코드없는 문서 유형 선언; 유효성 검사없이 구문 분석합니다 (이 파일을 넣으면)) 행 19, 열 3 : 인스턴스에 "DOCTYPE"선언이 허용되지 않습니다. 행 20, 열 6 : 문서 유형은 허용되지 않습니다. 여기서 "HTML"요소 허용

하지만 fx와 같은 HTML 태그는 사용하지 않습니다. 이 파일들에서 PHP 파일을 생성 해주었습니다.

내 index.php에는 다음과 같습니다

<?php 

include "magic-1.4.php";  
include "background.php"; 

$page = new Page(); 
$title = "Cupcake Lovers"; 
$href = "styles.css"; 
$page->title($title)->css($href); 
$wrapper = html("div")->id("mainWrapper"); 
$content = html("div")->id("allContent"); 

$content->append(file_get_contents("views/nav.php")); 

$section = new HtmlElm("section"); 

$request = new Controller(); 
if($request->has("page")){ 
    $requestedPage = $request->get("page"); 
} 
else{ 
    $requestedPage = 'home'; 
} 

if($requestedPage=="home"){ 
    $content->append(file_get_contents("views/home.php")); 
} 

$wrapper->append($content); 
$page->body($wrapper); 

//convert the page object to HTML and echo it to browser echo 
$page->asHTML(); 

그래서 제 질문은 내가 뭘 잘못이다, PHP는 3 HTML 페이지처럼 생성하고 정말 잘못 유효성을 검사하기 때문이다.

답변

1

<!DOCTYPE html>은 브라우저에서 가장 먼저 알아야 할 것이므로 다른 모든 것보다 먼저 처리해야합니다. <div id="mainWrapperbackground"><body>으로 이동해야합니다. 이 후에는 유효성 검사기가 하나씩 오류를 확인해야합니다.

+0

다른 12 개의 오류가 계속 발생합니다. :-) –

관련 문제