leptoon Posted October 20, 2009 Share Posted October 20, 2009 Not sure if its possible, but I need to write a cookie with a url. So this would write 2232 as the cookie for ID. http://www.example.com/redirect.php?ID=2232 Ultimately, I'm working on a pixel tracking script for an incentive website. If you can help, I'll be eternally grateful lol. Link to comment https://forums.phpfreaks.com/topic/178363-need-to-write-a-cookie-with-a-url-var/ Share on other sites More sharing options...
Dorky Posted October 20, 2009 Share Posted October 20, 2009 Not sure if its possible, but I need to write a cookie with a url. So this would write 2232 as the cookie for ID. http://www.example.com/redirect.php?ID=2232 Ultimately, I'm working on a pixel tracking script for an incentive website. If you can help, I'll be eternally grateful lol. so you want to store the url in the cookie? Link to comment https://forums.phpfreaks.com/topic/178363-need-to-write-a-cookie-with-a-url-var/#findComment-940581 Share on other sites More sharing options...
janusmccarthy Posted October 20, 2009 Share Posted October 20, 2009 Not sure if its possible, but I need to write a cookie with a url. So this would write 2232 as the cookie for ID. http://www.example.com/redirect.php?ID=2232 Ultimately, I'm working on a pixel tracking script for an incentive website. If you can help, I'll be eternally grateful lol. I would personally use a session. However, if you want to manage cookies yourself then you want to use setcookie: http://php.net/manual/en/function.setcookie.php Link to comment https://forums.phpfreaks.com/topic/178363-need-to-write-a-cookie-with-a-url-var/#findComment-940609 Share on other sites More sharing options...
leptoon Posted October 20, 2009 Author Share Posted October 20, 2009 Not sure if its possible, but I need to write a cookie with a url. So this would write 2232 as the cookie for ID. http://www.example.com/redirect.php?ID=2232 Ultimately, I'm working on a pixel tracking script for an incentive website. If you can help, I'll be eternally grateful lol. so you want to store the url in the cookie? No, I want to use the URL to create a cookie. Link to comment https://forums.phpfreaks.com/topic/178363-need-to-write-a-cookie-with-a-url-var/#findComment-940626 Share on other sites More sharing options...
thebadbad Posted October 20, 2009 Share Posted October 20, 2009 Simple. $_GET['ID'] will contain the id, and janusmccarthy already pointed you to the manual page for the setcookie() function. Link to comment https://forums.phpfreaks.com/topic/178363-need-to-write-a-cookie-with-a-url-var/#findComment-940632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.