Posted by Geoff Berrow on 07/05/07 08:25
Message-ID: <1183606335.756753.85240@d30g2000prg.googlegroups.com> from
Kurrent contained the following:
>ack, this is close to what i originally did...on my second page i made
>all the default values in a form the carried over values, but i have
>so many variables i was hoping i don't have to register them one-by-
>one. Looks like i'm gonna have to rename my values and make some sort
>of loop to register them all.
Why rename?
foreach($_POST as $key=>$value){
//insert sanity check here
$_SESSION[$key]=$value;
}
But I'd probably do
foreach($_POST as $key=>$value){
//insert sanity check here
$_SESSION['data'][$key]=$value;
}
It's then a lot easier to get rid of the POSTed variables if you need to
ie unset($_SESSION['data'])
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
[Back to original message]
|