PHP Session et Cookies: Vérifier si les cookies sont activés

 
<?php
    if(!isset($_GET['testcookie'])) {
        setcookie("testcookie", "test value");
        header("Location:  {$_SERVER["PHP_SELF"]}?testcookie=1");
        exit;
    } else {
        if(isset($_COOKIE['testcookie'])) {
            setcookie("testcookie");
            echo "You have cookies enabled";
        } else {
            echo "You do not support cookies!";
        }
    }
?>
  
  
 
<?php
 
    if(!isset($_GET['testcookie'])) {
 
        setcookie("testcookie", "test value");
        header("Location:  {$_SERVER["PHP_SELF"]}?testcookie=1");
        exit;
 
    } else {
 
        if(isset($_COOKIE['testcookie'])) {
 
            setcookie("testcookie");
            echo "You have cookies enabled";
 
        } else {
 
            echo "You do not support cookies!";
 
        }
    }
 
?>
  
  

No Comments

  • Your comment is awaiting moderation

    Although Swarovski jewelry is among the best crystal jewelry made it can be discovered
    at many local jewelry shops in addition to several locations on the web.

    My homepage wrap bracelets leather

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>