Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: One script, multiple html forms?

by TJPride (Pilgrim)
on Apr 04, 2013 at 12:23 UTC ( [id://1026984]=note: print w/replies, xml ) Need Help??


in reply to One script, multiple html forms?

Have the master script check for a GET variable called "session" or whatever. If it doesn't exist, create one (32-character md5_hex of microtime and rand) and forward to a new URL with the session variable tacked on the end. If it does exist, check your database for stored forms with that session ID, and randomly pick from any of the six forms the user hasn't done yet. Pass the form type as a hidden field with each one so when it's submitted you know where to store the data. When you detect that six forms have been stored, display a thank-you message.

I use similar techniques for multiple-page sessions all the time. Session ID's in the URL are fairly reliable.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1026984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found