Skip to content

PHP Code Snippets > Random Password Generator

by Steve Dawson Web Developer


Add a bit of interaction to your website without doing anything. You can change a banner on your website each month automatically with the help of PHP and a little snippet of code.

An Example ..


December


Simply create an image and name it as 01, 02, 03 etc, in our example we have gone up to 12, which covers the months of the year but our images can be called anything as long as you reference them in the php code.


The Monthly Photo code ..

Copy and paste the following code into your website where you would like the photos to be displayed.


<?php
// display a monthly photo/message
if (date ("m") == "01") {echo "<img src=\"01.jpg\" /> January";}
if (
date ("m") == "02") {echo "<img src=\"02.jpg\" /> February";}
if (
date ("m") == "03") {echo "<img src=\"03.jpg\" /> March";}
if (
date ("m") == "04") {echo "<img src=\"04.jpg\" /> April";}
if (
date ("m") == "05") {echo "<img src=\"05.jpg\" /> May";}
if (
date ("m") == "06") {echo "<img src=\"06.jpg\" /> June";}
if (
date ("m") == "07") {echo "<img src=\"07.jpg\" /> July";}
if (
date ("m") == "08") {echo "<img src=\"08.jpg\" /> August";}
if (
date ("m") == "09") {echo "<img src=\"09.jpg\" /> September";}
if (
date ("m") == "10") {echo "<img src=\"10.jpg\" /> October";}
if (
date ("m") == "11") {echo "<img src=\"11.jpg\" /> November";}
if (
date ("m") == "12") {echo "<img src=\"12.jpg\" /> December";}
?>

Free Quote available for any custom PHP and Database Software, Contact Steve Dawson Today