Here's a sample of a very simple php/mySQL snippet I have used for this in the past. LIMIT by however many random images you wish to display. Can be modified fairly easy to extend its use (image size, separate associated alt and description etc.)

CREATE TABLE `imgrotate` (
  `img` varchar(50) default NULL,
  `desc` varchar(200) default NULL
) TYPE=MyISAM;

INSERT INTO `imgrotate` (`img`,`desc`) VALUES ("name.jpg","description");

<?php
$result = mysql_query ("SELECT * FROM imgrotate ORDER BY RAND() LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$img = $row["img"];
$desc = $row["desc"];
}
?>
<img src="path/to/images/<?=$img?>" alt="<?=$desc?>" />


May be of some use...

Christiaan

On 22/07/2004, at 4:05 PM, Jackie Reid wrote:

Hi

we use rotator php scripts and all we do is something like this.....

<img src="images/headers/rotate.php" height="96" width="750" alt="some alt
tag or another" />


You only end up with a single alt tag for all images though so that might be
a problem for you, but the site validates just fine



Jackie

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************




Reply via email to