Page 1 of 1

Cookies Enabled/Disabled

Posted: Fri Jun 02, 2006 2:45 pm
by tecktalkcm0391
How can I make it so that if cookies are enabled it displays the HTML on the page, and if not it just displays a message like "Cookies must be enabled".

Code: Select all

<?php
//Cookie Check --- I could just help on that 
if (!$check_cookie){
?>
HTML FOR ERR MESSAGE

<?php 
} else {
 ?>

HTML FOR PAGE

<?php 
}
?>

Posted: Fri Jun 02, 2006 2:49 pm
by feyd
Attempt to set a cookie on an intermediate page. Using a page level redirect to move forward, check that the cookie exists and is correct on the following page.

Posted: Fri Jun 02, 2006 2:49 pm
by PrObLeM
You can use javascript. After a quick google search I found this http://techpatterns.com/downloads/javas ... ookies.php hopefully it helps.