Hello everyone,
I have a problem and I’m a real newbie with PHP.
My client forced me into putting a flash animation that pops in a thickbox when a visitor visits the homepage. He also wants that the animation doesn’t appear when the visitor returns to the homepage from a link in the website.
I don’t know how to detect a referrer from the website. Everything I tried (using http_referer) also hid the animation when the visitor entered the URL in the adress bar.
I’m also open using cookies, which is what I’m trying right now. The cookies solution I have works in Firefox but not on IE browsers, I don’t know if it’s a browser config problem or not, but it doesn’t work at my client side.
Here is my current solution:
<?php
if(isset($_COOKIE['animintro'])){ ?>
<?php } else {
$two_months = 60 * 60 * 1 * 0 + time();
setcookie('animintro', true, $two_months);
?>
<script type="text/javascript">
window.onload = function() {
var options = {
overlayColor: '#000000',
overlayOpacity: 0.9,
flashVars:{quality:'high',classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'}, flashParams:{quality:'high',classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'}
};
Shadowbox.init(options);
// open a welcome message as soon as the window loads
Shadowbox.open({
content: 'http://www.example.com/shop/skin/frontend/default/blank/flash/animation-accueil.swf',
player: 'swf',
height: 403, width: 623
});
};
</script>
<?php } ?>
Anyone has an idea? Thanks in advance.