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 に答える