something simple like this should get it...using mt_rand(), $randval will just be a number between 1 and 3...and it just gets tacked onto the end of your flash file (flash_movie{number}.swf) name within the object tag. so anytime the page is loaded, flash_movie1.swf, flash_movie2.swf or flash_movie3.swf will load...everything should be peachy as long as all the movies are the same size, otherwise you will have to do some if / thens or a small function to write the different parameters for the object & embed tags.
Geoff
PHP Code:
<?php
// seed the random number generator
mt_srand ((float) microtime() * 1000000);
// generate a random number
$randval = mt_rand(1, 3);
?>
<html>
<head>
<title>index</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</head>
<body bgcolor=#FFFFFF>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=620 HEIGHT=426>
<PARAM NAME=movie VALUE="flash_movie<?php echo $randval ?>.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="flash_movie<?php echo $randval ?>.swf" quality=high bgcolor=#FFFFFF
WIDTH=620 HEIGHT=426 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</body>
</html>
Bookmarks