Как я могу получить PHP INCLUDE работает?

0

ниже приведен мой код для php. Я предполагаю, что я ввожу правильный код, но он просто не преуспевает:

Вот мой headertop.php:

'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>HOME</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="description" content="Slide Down Box Menu with jQuery and CSS3" />
    <meta name="keywords" content="jquery, css3, sliding, box, menu, cube, navigation,    
portfolio, thumbnails"/>
    <link rel="shortcut icon" href="images/art_favicon.png" type="image/x-  
icon"/>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
</head>


<header> 
<?php            


 <div id="headertop">

    <div id="adams">

        <p><span style="color: #F60;">A</span>ncajas <span style="color:   
#F60;">D</span>igital <span style="color: #F60;">A</span>rts &amp; <span style="color: 
#F60;">M</span>edia <span style="color: #F60;">S</span>olutions</p>

    </div>

</div>

?>     
</header> 


</head>

</html>'

И вот мой index.php:

'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>HOME</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="description" content="Slide Down Box Menu with jQuery and CSS3" />
    <meta name="keywords" content="jquery, css3, sliding, box, menu, cube, navigation, 
portfolio, thumbnails"/>
    <link rel="shortcut icon" href="images/art_favicon.png" type="image/x-
icon"/>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>

    <style>

        body{
            background-image: url(images/graphy.png);
            font-family:Arial, Helvetica, sans-serif;
            margin: 0;
            padding: 0;
        }
    </style>

</head>

<header>
<?php

include ('headertop.php');

?>

</header>

<body>

<div id="contents">

</div>

</body>

</html>'

И, конечно, мой CSS для части заголовка:

'#headertop{
width: 1050px;
height: auto;
background-color: #252525;
margin-left: auto;
margin-right: auto;
position: inherit;  
border-top: solid #F60 2px;
margin-bottom: 0px;

/*border-bottom: solid #F60 1px;*/ 
}

#adams{
font-family:"Trajan Pro";
font-weight: 100;
font-size: 24px;
text-align: center;
color: #CCC;
padding-bottom: 6px;
margin-bottom: 17px;            
}

header{
width: 1050px;
height: 300px;
/*background-image:url(../interactive/product_slideshow.swf);*/
/*background-color: #999;*/
margin-left: auto;
margin-right: auto; 
}'

Спасибо, ребята, за поддержку.

  • 0
    Можете ли вы объяснить, как это не работает?
  • 0
    @aksu Даже если это кажется очевидной ошибкой, пожалуйста, не меняйте код ОП. Это на самом деле может быть ошибкой, которую делает ОП. Откат к первой версии.
Показать ещё 2 комментария
Теги:
include

1 ответ

0

Это должно быть где-то ошибка:

<?php
 <div id="headertop">

Он находится в вашем headertop.php. Кроме того, я рекомендую вам включать ошибки при кодировании, чтобы этого не повторилось.

Вам не нужно настраивать полный html в файле, который вы включаете, только бит, который вы хотите включить. Попробуйте изменить headertop.php на это:

<div id="headertop">
  <div id="adams">
    <p>
      <span style="color: #F60;">A</span>ncajas
      <span style="color: #F60;">D</span>igital
      <span style="color: #F60;">A</span>rts &amp;
      <span style="color: #F60;">M</span>edia
      <span style="color: #F60;">S</span>olutions
    </p>
  </div>
</div>
  • 0
    Фантастика! Спасибо!

Ещё вопросы

Сообщество Overcoder
Наверх
Меню