Make your web page more dynamic

This page demonstrates some easy little scripts in PHP. See a short description of how they work which I've written on The Horse's Mouth.

1. to show the current month and year on your page:
It is now October 2023

2. to include an image that steps through a cycle, showing each image in turn for 70 minutes:

Swainswick Wood

3. To include the content of a text file (that can contain a message of the day that you can easily update):
Message of the day
Hello world ...

4. To include the page's own URL:
This page is at

5. To display the source code of a PHP page (be very careful of this one - I'm using it to show you how this page works but it does reveal your tricks - and any security holes in them - to your site visitors:
<title>Early steps in PHP</title>
<body bgcolor=#FFCCFF>
<h1>Make your web page more dynamic</h1>
This page demonstrates some easy little scripts in PHP.
See <a href=>a
short description of how they work</a> which I've written on
<a href=>The Horse's Mouth</a>.
1. to show the current month and year on your page:<br>

It is now <?= date ("F Y"?>

2. to include an image that steps through a cycle, showing
each image in turn for 70 minutes:<center>

<?php $imagelist = array("klake","chill","swood");
#%% Some easy things to do with PHP
$textlist = array("Killingworth Lake","Crickely Hill",
"Swainswick Wood");
$picnumber floor(time()/60/70)%count($imagelist);
echo (
"<img src=$imagelist[$picnumber].jpg><br>");
echo (
"<b>$textlist[$picnumber]</b>"); ?>

3. To include the content of a text file (that can contain
a message of the day that you can easily update):<br>

<?php include("../../include/demo.txt"); ?>

4. To include the page's own URL:<br>
This page is at 

echo (

5. To display the source code of a PHP page (be very careful
of this one - I'm using it to show you how this page works
but it does reveal your tricks - and any security holes in 
them - to your site visitors:<br>

<?php /* highlight_file($_SERVER[SCRIPT_FILENAME]); */ ?>
/* PREVIOUS LINE works for most people  - we wrap it as
follows since our demo pages are wrapped in a protective blanket */ 
<?php highlight_file

Page by Graham Ellis of Well House Consultants.<br>

Page by Graham Ellis of Well House Consultants.

Training sample © 2023, WELL HOUSE CONSULTANTS LTD
This is
See source code here • More examples - same topic here
Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
Phone: +44 (0) 1225 708 225 • EMAIL: • WEB: