Re: An easier way? $_POST[] => $_SESSION[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks a million, this is exactly what I was looking for!

-- 
http://www.providenames.com
http://www.erichkolb.com
http://www.kolbsoft.com
http://www.phpquestions.com

"John Nichel" <john@xxxxxxxxxxxx> wrote in message 
news:41867E80.6070801@xxxxxxxxxxxxxxx
> Erich Kolb wrote:
>> Is there an easier way to assign all post data from a form to session 
>> data?
>>
>> Eg.,
>>
>> $_SESSION['first_name'] = $_POST['first_name'];
>> $_SESSION['last_name'] = $_POST['last_name'];
>>
>> $_SESSION['email'] = $_POST['email'];
>>
>
> If you're not worried about checking the integrity of your data...
>
> foreach ( $_POST as $key => $value ) {
> $_SESSION[$key] = $value;
> }
>
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john@xxxxxxxxxxxx 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux