hi
i found a code of cookies checking enabled or not ,but it is only for main page not for posts can u please help me , so that it also work for single posts thanx
here is code
i found a code of cookies checking enabled or not ,but it is only for main page not for posts can u please help me , so that it also work for single posts thanx
here is code
Code:
<?php
function cookies_enabled()
{
$cookie_sent = setcookie('tc','ok',time()+3600);
if($cookie_sent == false){die('Test cookie not sent');}
$redirected = (isset($_GET['cs']) && $_GET['cs'] == '1' ? $_GET['cs'] : '0');
if($redirected == '0')
{
header('Location: '.$_SERVER['PHP_SELF'].'?cs=1');return;//or should I put exit() ?
}
return (isset($_COOKIE['tc']) && strcmp($_COOKIE['tc'],'ok') === 0);
}
if(cookies_enabled())echo 'Cookies ON';
else echo 'Cookies OFF';
?>