美好的一天給大家。我有一個典型的設置A,M,P,我只是在我的本地主機服務器上進行一些測試以設置網頁。我對PHP和動態網站有點新,所以我儘管糊里糊塗。所以我在這裏陷入僵局。每當我嘗試在瀏覽器中查看頁面並單擊鏈接時,出現此錯誤:找不到對象!在此服務器上找不到請求的URL。 localhost
找不到對象! 在此服務器上找不到請求的URL。推薦頁面上的鏈接似乎是錯誤或過時的。請通知該頁面的作者關於錯誤。 如果您認爲這是服務器錯誤,請與網站管理員聯繫。 錯誤404 本地主機 的Apache/2.4.3(Win32的)的OpenSSL/1.0.1c PHP/5.4.7
my url looks like this: http://localhost/test/content/home
這裏是我的index.php頁面的代碼和我nav.php頁
第一的index.php
<?php
include('Config/setup.php');
?>
<?php
if(isset($_GET['page']) && $_GET['page'] == !'') {
$pg = $_GET['page'];
} else {
$pg = 'home';
}
#var_dump($pg);
#exit;
?>
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>FTS</title>
<link href="css/Styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header temp_Block">
<?php include('templates/header.php');?>
</div>
<div class="main_nav temp_Block">
<?php include('templates/main_nav.php');?>
</div>
<div class="main_Content temp_Block">
<?php include('Content/'.$pg.'.php');?>
</div>
<div class="footer temp_Block">
<?php include('templates/footer.php');?>
</div>
</body>
</html>
這裏是我的nav.php
<?php include('Config/setup.php')?>
<a href="/test/content/home">home</a>
<a href="/test/content/freestuff">free stuff</a>
<a href="/test/content/aboutus">about us</a>
<a href="/test/content/services">services</a>
<a href="/test/content/Whatwedobetter">What we do better</a>
我認爲這可能是一個權限問題,因爲/content/home.php位於xxamp/htdocs/test的子文件夾中。但我不完全確定。我可以在託管網站上測試這個,但是404錯誤讓我覺得它可能是localhost而不是我的代碼。
所有的幫助表示感謝,並提前致謝。
k我試試吧......不能傷害。 – user2089405 2013-02-23 22:45:07