mardi 31 juillet 2018

How to create a singular cookie (HELP!)

So I recently started to work with web. I need your help. I need to create a cookie who can remmember what a visitor chose in accessibility tab. I was reading a lot about them and still I'm not so good programmer I guess :D I started like this:

<?php
add_action( 'init', 'accessibility' );
function accessibility() {
setcookie($visitor_ip, $ip_value,7 * DAYS_IN_SECONDS);
}
?>`

but idk if it is right. After that idk how to call him that he will remmember this..:

<?php
if(!isset($_COOKIE[$visitor_ip])) {} 
else {}
?>`

If you can help me, would be wonderful. Website: web.kga.lt




Aucun commentaire:

Enregistrer un commentaire