note 25452 rejected from features.cookies by spic

From: Date: Tue, 24 Sep 2002 14:27:02 +0000
Subject: note 25452 rejected from features.cookies by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37188@lists.php.net to get a copy of this message
variable variable's vs. variable cookies -------------------------------------- this is more of a question really - i've been playing with cookies for a while now so i know that i'm not missing something or doing incorrect syntax. at any rate - this is the problem: i've got a value that i need to set for report modes to change based on which client a user might be looking at - like if they leave the report in one mode they want to come back to that same client in the same mode but not necessairily that mode for all clients that they will be looking at so i decided that setting a cookie would be good - but the cookie name needs to be dynamic. variable variables: --------------------------------------- $dynamic_value = "0123"; $var_var = "dynamic_var_name_" . $dynamic_value; // the dynamic var name ends up being: 'dynamic_var_name_0123' $dynamic_var_name_0123 = "output"; echo($$var_var); --------------------------------------- the last line echo's 'output' the problem is that when i try to dynamically set a cookie ("cookie_data[pre_" . $var . "]") it sets the cookie just fine but when i try to recall it dynamically it will not come up. anyone know if this has something to do with the cookie not being available in some fashion?

« previous php.notes (#37188) next »