Random link depending on week
This will display a link depending on which week of the month it is . You could put more than one link in , perhaps using arrays for the link and description . This will be our last script which demonstrates displaying content depending on which week of the month it is but you could have quotes , images , banners , news etc.
The script.
<?php
$week = date("j");
//week one link(s)
if ($week <= 7)
{
$url = "http://vbscript.myscripting.com";
$desc = "VBScript site";
}
//week two link(s)
else if ($week >=8 && $week <= 14)
{
$url = "http://asp.myscripting.com";
$desc = "Beginners ASP";
}
//week three link(s)
else if ($week >=15 && $week <=21)
{
$url = "http://www.beginnersphp.co.uk";
$desc = "Beginners PHP";
}
//week four link(s)
else
{
$url = "http://javascript.myscripting.com";
$desc = "JavaScript resources";
}
echo "<a href = \"$url\">$desc</a>";
?>
and here is this weeks link.
Beginners PHP