Re: An easier way? $_POST[] => $_SESSION[]
| From: | John Nichel | Date: | Mon, 01 Nov 2004 18:20:48 +0000 |
| Subject: | Re: An easier way? $_POST[] => $_SESSION[] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200855@lists.php.net to get a copy of this message | ||
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@kegworks.com