Jump to content

Archived

This topic is now archived and is closed to further replies.

w32

Cookie, using a dynamic value

Recommended Posts

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.

Share this post


Link to post
Share on other sites
thanks for your reply :D

though it didn't work for me :(  is that how its done?

I will keep trying, however. :)

Share this post


Link to post
Share on other sites
Did you get an error or something? I personally use sessions on my site and that's the same syntax that works for me.

Share this post


Link to post
Share on other sites
the result I was trying to echo didn't show up, when it was like this:
<?php
echo $_COOKIE['val1'];
?>

however this worked:
<?php
echo $_COOKIE[val1];
?>

thanks btw :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.