PHP包含文件执行失败


php included file execution failure

大家下午好。我被困在一个包含我所有"头部"信息的文件中。我想分解我的页面,使它更简单,不那么复杂。在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>

您可以尝试使用基本路径

<?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>