0

I have one root folder called GASS where I put all my php files and other related folders (templates,images,js,fonts,css)inside. When i try to run my project in localhost, http://localhost/GASS/alarm_A16GSM.php everything went smoothly. I wanted to change the URL to be more specific, http://localhost/GASS/alarmsystem/16zone/A16/overview.php thus i rename the php file and put it inside folders.

  • GASS
    • alarm-system
      • 16-zone
        • A16
          • overview

However when i try to run the new URL,the page shows error.

Code for the first URL where the page load successfully.

 <div class="overview"><a href="alarm_A16GSM.php" id="overview-selected"><span>

Code for the new URL where the page shows error.

<a href="alarm-system/16-zone/A16/overview.php" id="overview-selected">

This is the error message:

Warning: include(templates/header.php): failed to open stream: No such file or directory in .....

How am i going to load the page successfully using the new URL? How am i going to traverse four levels up to the root directory so that the page load successfully? Why i cannot directly call the php file using the(alarm-system/16-zone/A16/overview.php) path?

p/s: sorry for my bad English.

4

1 に答える 1

0

新しい URL 構造に合わせて、すべての相対 URL を更新する必要があるようです。

あなたの、

<link rel="stylesheet" href="css/style.css">

 <script src="js/main.js"></script>

/css/style.css代わりに試してみてくださいcss/style.css。問題が解決する場合があります。

アップデート

新しい URL 構造に合わせてリンクも変更してください

<a href="alarm-system/16-zone/A16/overview.php" id="overview-selected">
于 2013-10-18T02:46:07.107 に答える