Hi there,
So I thought this would be simple and it should be but I can't see what is wrong. Basically I am checking what language has been selected (via a code stored in a constant LANG_CODE) and then loading in a specific swf file.
Except that the language code part of the filename I am trying to output is not there in the source code but is there when I just echo it to the browser as text.
Here's the code for it. Any help is very much appreciated.
if ( isset($_SERVER['HTTP_REFERER']) ){
$referer = basename($_SERVER['HTTP_REFERER']);
}
else{
$referer = 'default_page.php';
}
$lang_version = LANG_CODE;
if( $referer == 'page_1.php' ){
$flash = 'console_'.$lang_version.'.swf';
}
elseif( $referer == 'page_2.php' ){
$flash = 'io_'.$lang_version.'.swf';
}
elseif( $referer == 'page_3.php' ){
$flash = "console_".$lang_version.".swf";
}
elseif( $referer == 'page_4.php' ){
$flash = "console_".$lang_version.".swf";
}
else{
$flash = "console_".$lang_version.".swf";
}
echo'
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="738" height="404" id="SONAR" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="swf_includes/'.$flash.'" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="swf_includes/'.$flash.'" quality="high" bgcolor="#ffffff" width="738"
height="404" name="mymovie" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>';
I have also tried this code for outputting the flash (still isn't working):
echo"
<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"
codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"
width=\"738\" height=\"404\" id=\"SONAR\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"movie\" value=\"swf_includes/$flash\" />
<param name=\"quality\" value=\"high\" />
<param name=\"bgcolor\" value=\"#ffffff\" />
<embed src=\"swf_includes/$flash\" quality=\"high\" bgcolor=\"#ffffff\" width=\"738\"
height=\"404\" name=\"mymovie\" align=\"middle\" allowScriptAccess=\"sameDomain\"
type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />
</object>";