NYCPHP Meetup

NYPHP.org

[nycphp-talk] handling forms (relative newbie)

Scott Mattocks crisscott at netzero.com
Thu Oct 2 15:58:44 EDT 2003


If you used $_SESSION['_POST'] = $_POST then the session array has as an 
element an array containing the post data.  Since you have an array in 
an array you would access it like this:
echo $_SESSION['_POST']['first_name'];

Scott Mattocks

Aaron Fischer wrote:

> That works, thanks!
> 
> One thing I am wondering is why one needs to use the line:
> $_POST = $_SESSION['_POST'];
> 
> If $_SESSION now has the array stored, it seems that this should work:
> echo $_SESSION['first_name'];
> 
> ?
> 
> -Aaron
> 
> On Thursday, October 2, 2003, at 03:26 pm, David Rydell wrote:
> 
>> session_start();
>> session_register('_POST');
>> $_SESSION['_POST'] = $_POST;
>> header ("Location: session_results.php");
>> exit;
>>
>> Session Results page:
>>
>> session_start();
>> $_POST = $_SESSION['_POST'];
>>
>> echo $_POST['first_name'];
>> echo $_POST['last_name'];
> 
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 




More information about the talk mailing list