w32 Posted July 29, 2006 Share Posted July 29, 2006 So I have a cookie set, and I named it with a dynamic value. And I do not know how to retrieve its value.so lets say I have a varialble, like $val1 how can I retrieve the cookie? $_COOKIE['$val1']; ??Can you please tell he how can it be done, if it can?Thanks. Link to comment https://forums.phpfreaks.com/topic/15978-cookie-using-a-dynamic-value/ Share on other sites More sharing options...
pixy Posted July 30, 2006 Share Posted July 30, 2006 <?phpecho $_COOKIE['val1'];?> Link to comment https://forums.phpfreaks.com/topic/15978-cookie-using-a-dynamic-value/#findComment-65654 Share on other sites More sharing options...
w32 Posted July 30, 2006 Author Share Posted July 30, 2006 thanks for your reply :Dthough it didn't work for me :( is that how its done?I will keep trying, however. :) Link to comment https://forums.phpfreaks.com/topic/15978-cookie-using-a-dynamic-value/#findComment-65657 Share on other sites More sharing options...
pixy Posted July 30, 2006 Share Posted July 30, 2006 Did you get an error or something? I personally use sessions on my site and that's the same syntax that works for me. Link to comment https://forums.phpfreaks.com/topic/15978-cookie-using-a-dynamic-value/#findComment-65711 Share on other sites More sharing options...
w32 Posted July 30, 2006 Author Share Posted July 30, 2006 the result I was trying to echo didn't show up, when it was like this:<?phpecho $_COOKIE['val1'];?>however this worked:<?phpecho $_COOKIE[val1];?>thanks btw :) Link to comment https://forums.phpfreaks.com/topic/15978-cookie-using-a-dynamic-value/#findComment-65741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.