kiowa_jackson Posted February 21, 2008 Share Posted February 21, 2008 I want someone who is coming in with the link www.mydomain.com/index.php?msg=1 to get a cookie set called msg with the value 1. I tried using this: <?php $days = 360; $time = time() + ($days * 86400); setcookie('msg', $msg, $time); ?> but to no avail. Can someone tell me what I need to change to make it work? Thanks Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 21, 2008 Share Posted February 21, 2008 use $_GET to get the stuff from the query string: <?php $days = 360; $time = time() + ($days * 86400); setcookie('msg', $_GET['msg'], $time); ?> Quote Link to comment Share on other sites More sharing options...
kiowa_jackson Posted February 21, 2008 Author Share Posted February 21, 2008 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.