我想讓我的索引頁面顯示當前的季度和年份,以便隨着時間的推移而更新。我需要幫助重建我的代碼。這裏是。它像某種形式的公告牌日曆:如何在PHP中包含URL?
$now = new DateTime();
$month = (int)$now->format("m");
$get_year = date("Y");
if ($month >= 1 AND $month <= 3) {
include_once("../index.php?year=".$get_year."&quarter=Q1");
}
elseif ($month >= 4 AND $month <= 6) {
include_once("../jet/index.php?year=".$get_year."&quarter=Q2");
}
elseif ($month >= 7 AND $month <= 9) {
include_once("../jet/index.php?year=".$get_year."&quarter=Q3");
}
else {
include_once("../jet/index.php?year=".$get_year."&quarter=Q4");
}
將被顯示在頁面準備好了,它只是我不能它和結果顯示這些錯誤:
警告:include_once(... D:\ xampp \ htdocs \ jet \ index.php 121行上的結果太大
警告:include_once()[function.include]:無法在D:中包含(include_path ='.; D:\ xampp \ php \ PEAR')打開'.../index.php?year = 2012 & quarter = Q3' \ XAMPP \^h tdocs \ jet \ index.php上線121
幫助任何人?
可能重複http://stackoverflow.com/questions/8301552/php-include-file-not-working-when-variables-are-put-in-url – fdomig 2012-08-14 06:34:07
通過這篇文章http://stackoverflow.com/questions/5509929/passing-parameter-while-including-php-script – WatsMyName 2012-08-14 06:36:11
1.你有什麼在121行index.php? – 2012-08-14 06:37:18