Cookie

Discussion in 'Web Hosting' started by Vilkas, Aug 1, 2018.

  1. #1
    Hello guys. So I recently began to create a new web. Everything looks good except one thing, idk how to create a cookie. What I want that when you choose what you want to do in accessibility tab it will stay in other pages. Photos here:
    https://ibb.co/jNpgWK
    https://ibb.co/dR10Qe
    https://ibb.co/f8xDdz
    Mb someone know how to do that? I was searching a lot on google but didn't find anything... This is the code I was writing at the beggining:
    <?php
      add_action( 'init', 'accessibility' );
      function accessibility() {
          setcookie($visitor_ip, $ip_value,7 * DAYS_IN_SECONDS);
        }
    ?>
    idk if it is right :D After that I didn't know how to call that code..:
    <?php
        if(!isset($_COOKIE[$visitor_ip])) {
        }
        else {
        }
    ?>
    PHP:

     
    Vilkas, Aug 1, 2018 IP