[BNM] Setting cookie name using a variable (PHP)
Rus Hughes
rus at digitalbrain.com
Thu Nov 1 10:04:15 GMT 2007
totally correct, i would have thought this would have worked:
setcookie($itemName, $like, $inTwoMonths);
what value is $itemName?
from the Netscape spec:
/NAME/=/VALUE/
This string is a sequence of characters excluding semi-colon, comma
and white space. If there is a need to place such data in the name
or value, some encoding method such as URL style %XX encoding is
recommended, though no encoding is defined or required.
wayne wrote:
> I don't know didly squat about PHP but I would have thought putting a variable name inside single quotes would give you a string literal containing the name of the variable?
>
>
>
> ________________________________
>
> From: bnmlist-bounces at brightonnewmedia.org on behalf of delarge
> Sent: Thu 01/11/2007 09:45
> To: Brighton New Media
> Subject: [BNM] Setting cookie name using a variable (PHP)
>
>
>
> What oh
>
> I have been trying set some cookies using a variable name like so:
>
> setcookie('$itemName', $like, $inTwoMonths);
>
> But it doesn't work - it actually calls the cookie '$itemName'
> Tried without the apostrophes as well but no joy
>
> Is what I'm trying to do possible?
> Can I set a dynamically named cookie?
>
> --
> Paul Burgess
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> List jobs for 10 pounds on Sussex Digital. Use promo code bnm10 http://jobs.sussexdigital.com/
>
> Join BNM on Linkedin - http://www.linkedin.com/e/gis/23805/5841CA3F0360
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com <http://www.wessexnetworks.com/>
>
>
>
More information about the BNMlist
mailing list. Powered by Wessex Networks