【发布时间】:2012-08-10 10:15:10
【问题描述】:
我想让我的索引页面显示当前季度和年份,以便随着时间的推移而更新。我需要帮助重建我的代码。这里是。它就像某种公告板日历:
$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(.../index.php?year=2012&quarter=Q3) [function.include-once]:无法打开流:D:\xampp\htdocs\jet\index.php 中的结果太大在第 121 行
警告:include_once() [function.include]: 未能打开 '.../index.php?year=2012&quarter=Q3' 以包含 (include_path='.;D:\xampp\php\PEAR') D:\xampp\htdocs\jet\index.php 在第 121 行
帮助任何人?
【问题讨论】:
-
1.你在 index.php 的第 121 行有什么?
-
@IonutFlaviusPogacian include_once("../jet/index.php?year=".$get_year."&quarter=Q3");
-
@IonutFlaviusPogacian 他想要的东西我已经回答了,header() 不会无限循环。