My web site sets a cookie using the following code: function alphanumericAndSpace( $string ) { $length = 80; return substr (preg_replace('/[^a-zA-Z0-9\s]/', '', $string),0,$length); } if (isset($_GET['kw'])) { setcookie('keyword', alphanumericAndSpace($_GET['kw']), time()+365*60*24*60); } if (isset($_COOKIE['keyword'])) { $kw = alphanumericAndSpace($_COOKIE['keyword']); } Code (markup): and the result is a cookie "keyword" with a "value" I would like to set another cookie "keyword2" with its own "value" I would like to keep the 2nd cookie value clean just like the first cookie. What code would I have to write to set the second cookie? Appreciate your help Thanks Mike
Based on your codes, it would be: setcookie('keyword2', alphanumericAndSpace($ownvalue), time()+365*60*24*60); PHP: Change the $ownvalue yourself
Thanks for the real quick reply. Sorry I did not explain that well. What I meant was another value from another variable say "kw2" Thanks
Simply setcookie another function, with the second cookie name and value of second keyword. are you looking for help in getting the second key word?
Thanks for that. Yes I sorted it out this morning. It was easier than I thought. But thanks for getting back on this. Mike