有一個問題在這些地方
$_SERVER['REQUEST_URI']
被吐出: /dev/nava2/store/index.php?route=product/product&product_id=48
實際的URL /dev/nava2/store/index.php?route=product/product&product_id=48
很明顯,區別在於頂部的&
與底部的&
full co de看起來像這樣:
$currentpage = $_SERVER['REQUEST_URI'];
$classic = "/dev/nava2/store/index.php?route=product/product&product_id=48";
if ($currentpage == $classic)
{ $classicclass = "current";
}
else { echo "";}
有什麼建議嗎?
這個伎倆!感謝將在5標記爲正確。 – 2011-03-11 20:49:02
並且url不應該包含'&'而是'&',然而大多數瀏覽器/ web服務器將會努力糾正用戶輸入...參見[w3c附錄B:§B.2.2](http ://www.w3.org/TR/html4/appendix/notes.html#hB.2.2)。 – 2012-10-27 13:00:26