0

大家下午好。我坚持包含一个包含我所有“头部”信息的文件。我想分解我的页面,让它更简单、更简单。在我的 index.php 文件中,我这样做了;

 <?php
 include 'Resources/includes/head.php';
 ?>

它找到了该文件,我知道这一点,因为在 Dreamweaver 中,当我进入索引页面时,它会在其下方显示为一个选项卡。但是,当我在本地服务器上查看我的索引页面时,就好像没有任何样式或脚本应用于该页面。这是我的 head.php 文件中的代码。

  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="description" content="" />
  <meta name="keywords" content=""/>
  <link rel="shortcut icon" href="../images/design/icon.png" type="image/x-icon"/>
  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/>
  <script src="../js/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script src="../js/scripts.js" type="text/javascript"></script>
  </head>
4

1 回答 1

0

您可以通过使用基本路径来尝试这样的事情

<?php
$basepath="http://www.mysite.com/path_to_theme/";
?>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="description" content="" />
  <meta name="keywords" content=""/>
  <link rel="shortcut icon" href="<?php echo $basepath; ?>/images/design/icon.png" type="image/x-icon"/>
  <link rel="stylesheet" href="<?php echo $basepath; ?>/css/style.css" type="text/css" media="screen"/>
  <script src="<?php echo $basepath; ?>/js/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script src="<?php echo $basepath; ?>/js/scripts.js" type="text/javascript"></script>
  </head>
于 2013-05-25T12:15:44.003 回答