This is my code which is intended to produce an URL like the following:
www.mysite.com/test.php?day=1
<?
if (!$_GET['day']) {
$day = date('N');
}
elseif ($_GET['day']==1){ ?>
<?php include("test1.php") ?>
<? }else if($_GET['day']==2){ ?>
<?php include("test2.php") ?>
<? }else if($_GET['day']==3){ ?>
<?php include("test3.php") ?>
<? }else if($_GET['day']==4){ ?>
<?php include("test4.php") ?>
<? }else if($_GET['day']==5){ ?>
<?php include("test5.php") ?>
<? }else if($_GET['day']==6){ ?>
<?php include("test6.php") ?>
<? }else if($_GET['day']==5){ ?>
<?php include("test7.php") ?>
<? }else if(!is_numeric($_GET['id']) || $_GET['id']<1){ ?>
invalid id (or page not found)
<? } ?>
?>
<?php
$dat=date("w");
switch ($dat)
{
case 1:
include("test1.php");
break;
case 2:
include("test2.php");
break;
case 3:
include("test2.php");
break;
case 4:
include("test4.php");
break;
case 5:
include("test5.php");
break;
case 6:
include("test6.php");
break;
}
?>
The query string does work, but shows the same page - test1.php, no matter what day I call up in the PHP URL.
Anyone managed to get this working, as I tried and tried but can't figure it out!