Main Content
Daily Image Santafied Archive - Originally posted on "The Horse's Mouth" - 2005-12-22 04:28:03 - Graham Ellis
The image on our home page varies day by day (also based on the user's country of origin). For a few days in the lead-up to and immediate aftermath of Christmas though, it's replaced by a picture of an older man with a white beard in a red coat, bearing gifts for the children. Here's how:
$daze = time()/(3600*24);
[regular code to set image based on day and/or browser country]
if ($daze > 13136 and $daze < 13146) $image="santa2";
Some other articles
H112 - Further Web Page and Network Handling Moving from mysql to mysqli - simple worked example Passing variable between PHP pages - hidden fields, cookies and sessions Multiple page web applications - maintaining state - PHP Telling which ServerAlias your visitor used - useful during merging domains Easy session example in PHP - keeping each customers data apart 3 digit HTTP status codes - what are they, which are most common, which should be a concern? Sending out an email containing HTML from within a PHP page Downloading a report from the web for further local analysis Uploading a document or image to its own URL via a browser How to build a test harness into your PHP Shipping a test harness with your class in PHP http, https and ajp - comparison and choice Downloading data for use in Excel (from PHP / MySQL) Keeping staff up to date on hotel room status Script to present commonly used images - PHP PHP / Web 2 logging Single login and single threaded models - Java and PHP Copyright and theft of images, bandwidth and members. Simple page password protection - PHP .php or .html extension? Morally Static Pages PHP header() function - uses and new restrictions Updating a page strictly every minute (PHP, Perl) Improving searches - from OR to AND? PHP Image upload script Passing GET parameters through Apache mod_rewrite Global, Superglobal, Session variables - scope and persistance in PHP Of course I'll tell you by email Image maps for navigation - a straightforward example Hot answers in PHP Finding the language preference of a web site visitor Adding PHP tags to an old cgi program PHP - setting sort order with an associative array Using PHP to output images, XML, Style sheets, etc Morning image, afternoon image This article Setting the file name for a downloaded document Accessing a page via POST from within a PHP script Server side scripting of styles to suit the browser Caching an XML feed Reading a news or blog feed (RSS) in your PHP page What brings people to my web site? Time calculation in PHP Sudoku helper or sudoku cheat Spotting a denial of service attack What language is this written in? When to use Frames