Forum Moderators: coopster

Message Too Old, No Replies

Data extraction from an array name, not the key

Data extraction

         

Matthew1980

7:51 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello there people of webmaster world,

I want to append some data to a super global name, ie: $_COOKIE['cookie_name.#WERTG']; Then what my hope is, to be able to see if the cookie is set, by checking the main part of the name regerdless of what the appendage is. Then after determining as it IS set finding out what the data is, assigning it to a var, then checking that against a database reference.

Any advice or alternative suggestion is welcome.

Cheers,

MRb

eelixduppy

11:56 pm on Feb 2, 2010 (gmt 0)



What you are doing does not make any sense to me. If anything, this "appendage" should be stored as a separate variable or perhaps the index of an array:

$_COOKIE['cookie_name'] = serialize(array('WERTG' => 'value'));

The data is suppose to be contained within the cookie VALUE not the NAME.

Matthew1980

8:27 am on Feb 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there eelixduppy,

Thanks for the suggestion, I seem to have confused myself after re reading the post this morning! Doh.

Cheers,

MRb