Popup windows

P

Paul

I have this code on my index.php page. It works when cookies are switched
off but gets stuck in a loop when cookies are enabled. I think I know why,
its looping as I have defined the page that the user is already on as the
destination page if cookies are enabled. I thought this would work ok and
not get stuck in a loop. So, is there any way I can get this to work? I want
the user to remain on the index.php page but just be warned that cookies
have been disabled.

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var tmpcookie = new Date();
chkcookie = (tmpcookie.getTime() + '');
document.cookie = "chkcookie=" + chkcookie + "; path=/";
if (document.cookie.indexOf(chkcookie,0) < 0)
{
alert("Your browser is set to reject cookies, you must enable them to
use this website");
}
else
{
window.location = 'index.php';
}
//-->
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top