You are here: Re: carrying over variables from a form to multiple pages... « PHP Programming Language « IT news, forums, messages
Re: carrying over variables from a form to multiple pages...

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация