NYCPHP Meetup

NYPHP.org

[nycphp-talk] handling forms (relative newbie)

Aaron Fischer agfische at email.smith.edu
Thu Oct 2 15:12:55 EDT 2003


After some fumbling and stumbling I seem to have things working OK.  
However, right now I am naming each form element/post variable 
individually to put the data into session_register, which could be a 
pain the longer the form gets!  I would like to, as Adam put it, "stuff 
the POSTed data" into $_SESSION using $_POST but I don't see how to do 
this.

Example my code:
session_start();
session_register('first_name','last_name',etc.,etc.many more fields to 
follow...);
header ("Location: session_results.php");
exit;

Session Results page:
session_start();
echo "$_SESSION[first_name]";

Whenever I start trying to use session_register with _POST things go 
south quick.

Hints/suggestions?

TIA,

-Aaron

On Tuesday, September 30, 2003, at 04:23 pm, Adam Maccabee Trachtenberg 
wrote:

> My advice is to try it with cookies first because it might be easier
> to test. (On your machine, you don't need to worry about rejecting
> cookies.)
>
> Once that's working, add in the URL rewriting. This might not be
> necessary, but when dealing with something new, I don't like to jump
> in head first, as it makes it really difficult to debug.
>
> -adam




More information about the talk mailing list