NYCPHP Meetup

NYPHP.org

[nycphp-talk] handling forms (relative newbie)

Jeff Siegel jsiegel1 at optonline.net
Thu Oct 2 15:46:22 EDT 2003


I just did this.

session_id(); 
session_start();
$_SESSION = $_POST;

header("Location:myresultspage.php?code=" . session_id());
exit;

And then on the results page....


session_id($_GET['code']);
session_start();
$_POST = $_SESSION;

Jeff Siegel

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of Aaron Fischer
Sent: Thursday, October 02, 2003 2:13 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] handling forms (relative newbie)


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

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list