Someone wrote me this script which allows me to switch to a pure HTML page or
Flash embedded HTML page. Now I would like to use the script above to rotate my SWF files,
***but starting from " ECHO SRAND " I am having trouble coding it right. I think I am missing commas, slashes or ??? ***
Also without SRAND.... the script works fine.
Can anyone help me fix this, code below?
---------------------------------------------------------------------------
<?php
if ($_GET['choice']=="html"){
$_SESSION['format']=="html";
} elseif ($_GET['choice']=="flash") {
$_SESSION['format']=="flash";
}
if ($_SESSION['format']=="html") {
echo "<img src=\"images/fso_hometest.jpg\" width=\"776\" height=\"256\">";
}
elseif ($_SESSION['format']=="flash"){
$_SESSION['format']=="flash";
echo
srand ((double)microtime()*1000000);
//from 1 to the number of ads
$random_num = rand(1, 3);
$include_ad = "flash_banner" . $random_num . ".swf";
"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"776\" height=\"256\" id=\"tool_banner\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"movie\" value=\"<? echo $include_ad; ?>\" />
<param name=\"quality\" value=\"high\" />
<param name=\"bgcolor\" value=\"#ffffff\" />
<embed src=\"<? echo $include_ad; ?>\" quality=\"high\" bgcolor=\"#ffffff\" width=\"776\" height=\"256\" name=\"tool_banner\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
</object>";
}
?>
Flash embedded HTML page. Now I would like to use the script above to rotate my SWF files,
***but starting from " ECHO SRAND " I am having trouble coding it right. I think I am missing commas, slashes or ??? ***
Also without SRAND.... the script works fine.
Can anyone help me fix this, code below?
---------------------------------------------------------------------------
<?php
if ($_GET['choice']=="html"){
$_SESSION['format']=="html";
} elseif ($_GET['choice']=="flash") {
$_SESSION['format']=="flash";
}
if ($_SESSION['format']=="html") {
echo "<img src=\"images/fso_hometest.jpg\" width=\"776\" height=\"256\">";
}
elseif ($_SESSION['format']=="flash"){
$_SESSION['format']=="flash";
echo
srand ((double)microtime()*1000000);
//from 1 to the number of ads
$random_num = rand(1, 3);
$include_ad = "flash_banner" . $random_num . ".swf";
"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"776\" height=\"256\" id=\"tool_banner\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"movie\" value=\"<? echo $include_ad; ?>\" />
<param name=\"quality\" value=\"high\" />
<param name=\"bgcolor\" value=\"#ffffff\" />
<embed src=\"<? echo $include_ad; ?>\" quality=\"high\" bgcolor=\"#ffffff\" width=\"776\" height=\"256\" name=\"tool_banner\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
</object>";
}
?>
Last edited:

















