NYCPHP Meetup

NYPHP.org

[nycphp-talk] handling forms (relative newbie)

Jeff Siegel jsiegel1 at optonline.net
Tue Sep 30 17:21:46 EDT 2003


That's the solution I ended up implementing. 

Jeff "Repost post vars" Siegel

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of Adam Maccabee Trachtenberg
Sent: Tuesday, September 30, 2003 2:53 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] handling forms (relative newbie)


On Tue, 30 Sep 2003, Aaron Fischer wrote:

> Basically, I am using php to enforce required fields on a form, load
> a page that allows the user to confirm information is accurate (if
> not, reload the form page), and finally once all is OK, process the
> variables by inserting the data into mysql, sending an email
> confirmation to the user and loading a confirmation page.

> Possible solutions:
> 	Perform manual POST using PHP
> 	Use PEAR's http request class
> 	Use cURL
> 	Store $_POST as a session variable
> 	Use http.inc class
> 
> Thanks for any suggestions,

I advocate storing $_POST as a session variable. (Or the specific POST
variables you want to keep.)

You stuff the POSTed data into a temporary session and then retrieve
it out of $_SESSION in the confirmation page and MySQL insertion
page. Once it's done, session_destroy() it.

Saves you all the hassle of, well, most of the above. If you're against
cookies, there's always the URL rewriting feature of Session, which
should be easy to ensure given the nature of your transaction.

I'm all for using the simplest solution possible, unless you can't.

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

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




More information about the talk mailing list