Danu6.it.nuigalway.ie

Samples Home
This picture below is actually generated on the fly by php
If you wish to do the same then use the normal html IMG tage with the SRC pointing to a php page.
In the php page put the code to generate a picture
It shows a black image of 600 x 30 pixels, with the time and date overlayed as a string

PHP Code to generate the above:


Normal HTML code to display an image: <img src="picture.jpg">
Change the image source to point to a php file : <img src="picture.php">

Contents of picture.php file:
<?php
// Inform the browser what type of file this is i.e. image as png format
header ('Content-Type: image/png');
// Set the default timezone used by all date/time functions in a script
date_default_timezone_set('Europe/Dublin');
// allocate memory for the image
$im = @imagecreatetruecolor(41080)
    or die(
'Cannot Initialize new GD image stream');
// define a background colour to use
$background_color imagecolorallocate($im000);
// define a text colour to use
$text_color imagecolorallocate($im1423391);
// the text to display, in this case the current time
$datestring date('l jS \of F Y h:i:s A');
// place the text on the image
imagestring($im51010,  $datestring$text_color);
// convert bitmap image to png
imagepng($im);
// release local resources
imagedestroy($im);
?>