Hi. If you are looking for code to alert user if his cookies are enable or not, Then look the code as below:-
paste the code in you file
<?php
if (isset($_COOKIE['cookieCheck'])) {
echo 'Your cookie is Enable';
} else {
if (isset($_GET['reload'])) {
echo 'Sorry your cookie is not Enable';
} else {
setcookie('cookieCheck', '1', time() + 60);
header('Location: ' . $_SERVER['PHP_SELF'] . '?reload');
exit();
}
}
?>
Output:-
Sorry your cookie is not Enable
See the image example below:
Code:
Output:
0 Comment(s)