Another Session Question..

From: Date: Tue, 12 Mar 2002 21:22:49 +0000
Subject: Another Session Question..
Groups: php.general 
Request: Send a blank email to php-general+get-88242@lists.php.net to get a copy of this message
I asked a question the other day about turning $_REQUEST variables into $_SESSION variables...thanks, all who helped me with that... I have another question about assigning $_REQUEST variables to $_SESSION variables that I am hoping someone can help me out with.... Here is a snippit of code... while($r = mssql_fetch_array($result)) { $vname = $group_abbr . $count; $_SESSION[$vname] = $_REQUEST[$vname]; } Now an explanation... $vname is the actual name of the variable that is stored in the $_REQUEST array (and what I want it to be called in the $_SESSION array) can I do this: ? (for example, a1 so $_SESSION['a1'] = $_REQUEST['a1']; is what I want it to do...but I need to send the name of the variable as a variable...) I tried this... $_SESSION[$vname] = $_REQUEST[$vname]; ...but it doesn't seem to be working and I can't figure out how to get those variables registered.... Any help is much appreciated. Zara

« previous php.general (#88242) next »