<?php
function test_cookies_enabled(){
// Create the test cookie.
$success = setcookie("SnapBuilderTest","Testing cookies");
// If setcookie was successful, $success will be TRUE.
// Otherwise, it will be FALSE.
// Unset our cookie and return the result.
setcookie("SnapBuilderTest","",time()-60);
return $success;
}
$cookies = test_cookies_enabled();
if($cookies)
// set message for enabled cookies below
print "Okay, cookies are enabled!";
else
// set message for disabled cookies below
print "Oh No! Cookies are not enabled!";
?>
|