ok im running a cms site cpgnuke however im doing quite a bit of my own coding but unable to achieve one thing.
ive set up a cookie to check if a user has visited my website in 24 hours if they have it redirects the user to a advertisment page. the page displays a ad for 10 second and redirects to the index.php file.
this works fine. what i am wanting to try an achieve is. instead of this just redirecting from the ad page to the index.php page have it redirect to the previous page (if they were already on the site if the cookie resets) or have it direct the user to the url they were trying to access. (for example there was a link in google that doesnt direct to my front page, i want it to display the ad if they havent been to the site in the last 24 hours once the ad is done i want it to redirect to the page there were trying to access and not the main index page.)
so far what i have is pretty simple
setcookie("cookiead",1, time()+86400, "/" , ".fightersx.com");
also in the same header file
if(!isset($_COOKIE['cookiead']))
{
Header("Location: cookieadd.php");
}
then on cookieadd.php i have a meta refresh set to index.php.
if seen allot of big sites doing this but dont know how to get it to work as ive only been programing in php for about a year and a half.
so all i need is a redirect from the ad page to the url they were trying to go to.
and second a link on that page that allows then to by pass the 10 sec wait and go back or go to the page they requested.
can anyone help me with this.