0
我的鏈接樣本看起來像這樣「/jet/index.php?year=2011 & quarter = Q1」 現在我需要顯示包含第一個月的頁面季度之一2011年。 /jet/index.php?year=2011 &季度= Q1將顯示四月五月六月。等等。通過url中的多個變量顯示一個頁面
我的代碼看起來像這樣
<a href="index.php?year=2011&quarter=Q1">
<a href="index.php?year=2011&quarter=Q2">
<a href="index.php?year=2011&quarter=Q1">
<a href="index.php?year=2011&quarter=Q4">
我的主頁,這是2012年的作品就好了,這裏是代碼
<?php
$quarters = array('Q1' => 'firstq2012.php', 'Q2' => 'secondq2012.php', 'Q3' => 'thirdq2012.php', 'Q4' => 'fourthq2012.php');
if(isset($_GET['quarter'])) {
if(in_array($_GET['quarter'], array_keys($quarters))) {
include_once $quarters[$_GET['quarter']];
} else {
header('Location: 404.php');
}
} else {
include_once $quarters['Q3'];
}
?>
我需要你的幫助,我會從過渡2012年至2011年會看起來像(我通過鏈接)
謝謝!
很難解釋你的問題 – asprin 2012-07-31 11:05:49
在你上線之前:http://www.aeonity.com/frost/how-preventing-remote-file-inclusion-exploits-php – madflow 2012-07-31 11:16:24