September 16th, 2002, 03:31 AM
Example: User adds address and email in first form they then click submit and that data fills in the other forms. They have top be individual forms because I then want them to submit each form individually.
Any help would be appreciated as Im totally fizzed out on this one.
September 16th, 2002, 06:11 AM
If the user submits the form, and the page changes then there are two ways to store the data:
In a server-side table.
Possibly the best way to do it is in a table, simply generate a unique id, using uniqid() in PHP based on microtime(). Then store the data you've gathered in the table with that unique id as a primary key. Put the unique id as a query in the url, eg:
and then each page can look up the data in the table and retrieve the necessary data and fill in the form.
September 16th, 2002, 06:26 AM
September 16th, 2002, 06:36 AM
Getting the data into the cookies is easy.
document.cookie = "name=" + escape(name)
where the variable name holds the name value.
Getting it back is more complicated.
name = document.cookie.substring(document.cookie.indexOf("name=") + 5, document.cookie.length)
then further manipulations to get the exact part.
The other way is to use frames, then store all the form data in the parent frame as variables. Load the site into a 100% high/wide frame so that it doesn't look like it uses frames. This way the data will always be accessible as parent.name or something similar.