我是一個autodidact,所以不太瞭解傳統的網站開發,但是,我寫了一個完整的社交網站,但我不知道如何調試。我的網站上有一些問題,我需要學習的東西debuggin左右/調試PHP和控制流?
首先我需要說明如何在WAMP安裝Xdebug的(因爲我用phpDesigner)的。每次遇到新錯誤時,我都會在Web上使用教程。我也嘗試將它放在/ ext /目錄下,並從WAMP PHP Extensions菜單中激活它。不工作!
因此,如果有人使用PHPDesigner和Xdebug(不是附帶的軟件包,而是將其安裝在WAMP上),請幫助我,我真的很感激。 BTW PHP版本是5.3.0
接下來的事情是這是怎麼了我的網站的控制流程: -
htaccess -> redirect everything to index.php if file doesn't exist.
index.php ->
include all libraries (__autoload).
initialize classes.
Get the $_SERVER['REQUEST_URI'] to get the $page.
If $page is found
Check if the user is logged in,
if yes then include view/$page.php
or else redirect to login.php page
If page is not found then
redirect to 404.php
這是控制流適合調試?因爲我真的不能理解真正的MVC概念,所以我創建了這樣的東西。
感謝您的幫助,目前該網站是磺酰基社交所以它很容易..現在我想將它擴展到一個類似website.com/classifieds/ website.com/events/等分類的門戶網站,那麼如何實現這一目標?我的想法是在index.php中定義URL段,並根據段進行分頁,例如分類或事件或社交等。這是好的嗎? – 2009-11-25 09:11:10