i have a Site on My Adopts. and i'm using X10Hosting as a side host.
i have these two codes i got, and they work fine by themselves. but when i put them together it has an error and it says the page doesnt exist.
here is the code
basicly when i go to this page it redirects me to a random link, but i can only view this page. once a day.
without the once a day cookie code, it works fine
example
http://mysticdragonforest.x10.mx/MGexp2.php
but when i add the cookie code
http://mysticdragonforest.x10.mx/MG.php
i have these two codes i got, and they work fine by themselves. but when i put them together it has an error and it says the page doesnt exist.
here is the code
Code:
# if already visited, redirect to another page
if ( $_COOKIE[visited] == "br549" )
{
header("location: [URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=tootired"]www.mysticdragonforest.myadopts.com/pages.php?page=tootired[/URL]");
exit;
}
else
{
# Set Cookie & Expire Time
$expire = time()+60*60*24;
setcookie( "visited", "br549", $expire);
}
?>
$urls = array("[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=failed"]www.mysticdragonforest.myadopts.com/pages.php?page=failed[/URL]",
"[URL="http://www.mysticdragonforest.myadopts.com/pages.php?page=MGadopt56"]www.mysticdragonforest.myadopts.com/pages.php?page=MGadopt56[/URL]");
$url = $urls[array_rand($urls)];
header("Location: [URL]http://$url[/URL]");
?>
basicly when i go to this page it redirects me to a random link, but i can only view this page. once a day.
without the once a day cookie code, it works fine
example
http://mysticdragonforest.x10.mx/MGexp2.php
but when i add the cookie code
http://mysticdragonforest.x10.mx/MG.php