Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

ADD TO Progged Progged
ADD TO DEL.ICIO.US Del.icio.
ADD TO DIGG Digg
ADD TO FURL Furl
ADD TO NEWSVINE Newsvine
ADD TO NETSCAPE Netscape
ADD TO REDDIT Reddit
ADD TO STUMBLEUPON StumbleUpon
ADD TO TECHNORATI FAVORITES Technorati
ADD TO SQUIDOO Squidoo
ADD TO WINDOWS LIVE Windows Live
ADD TO YAHOO MYWEB Yahoo MyWeb
ADD TO ASK Ask
ADD TO GOOGLE Google
ADD TO MAGNOLIA Magnolia
ADD TO SPURL Spurl



 
 

SPONSORS



 
 

Display image depending on week

This example will display a different image every week , you could use this for advertising etc .

Here is the code for this example

<?php
$week = date("j");
//this is your image for week one
if ($week <=7 )
{
$image = "aspbanner1.gif";
}
//this is your image for week two
else if ($week >=8 && $week <=14)
{
$image = "aspbanner2.gif";
}
//this is your image for week three
else if ($week >=15 && $week <=21)
{
$image = "aspbanner3.gif";
}
//this is the image for all other days
else
{
$image = "aspbanner4.gif";
}
//display image
echo "<img src = \"$image\" >";
?>

And this displays the following banner in this case