On MY website, I have a animation that I only want it to play once when the use first visit the website. So I set up a session to check if the user visit for the first time. Below is my code:
if(!isset($_SESSION["playedit"]))
session_start();
if(isset($_SESSION["playedit"]))
$_SESSION["playedit"] = false;
else
$_SESSION["playedit"] = true;
<?php if($_SESSION["playedit"]){?>
//play animation
<?php } ?>
It's working on IE but for firefox and chrome, the animation always play twice. I don't know what's going on. Here the website: ryandang.com . I want the header animation to play only once
by play twice, I meant when user go to another page, it plays again
Oh it also work on my local machine. It just doesn't work on the host server. Do you think it has something to do with the host server?
Edit1: Here is the catch I just found out, If I access my site with link like ryandang.com/games or ryandang.com/works, It only play once. However, if I use ryandang.com which go to my index.php page which has 1 line of code header('Location: aboutme'); It will play twice!