This is my script, which is intended to show a different page depending on day of the week.
<html>
<? error_reporting(E_ALL);?>
<body>
<?
$i=$_GET['day'];
switch ($i) {
case 0:
include("2.php");
break;
case 1:
include("3.php");
break;
case 2:
include("4.php");
break;
case 7:
include("5.php");
break;
default:
echo "page not found!!!!";
}
?>
<?php
$d=date("D");
switch ($d)
{
case "Mon":
include("2.php");
//echo "Today is Monday";
break;
case "Tue":
include("3.php");
//echo "Today is Tuesday";
break;
case "Wed":
include("4.php");
//echo "Today is Wednesday";
break;
case "Thu":
include("5.php");
//echo "Today is Thursday";
break;
case "Fri":
include("6.php");
//echo "Today is Friday";
break;
case "Sat":
include("7.php");
//echo "Today is Saturday";
break;
case "Sun":
include("1.php");
//echo "Today is Sunday";
break;
default:
//echo "Wonder which day is this ?";
}
?>
When I run it, it partially works, but this notice appears at the top of the browser:
Notice: Undefined index: day in C:\www\vhosts\mywebsite1\dayweek.php on line 5
I would appreciate any advice anyone has on fixing this, since I always get the undefined index error, which makes the site not function properly.
Thanks