Transferring Variables



Hello everybody,

I have a problem with transferring variables from page to page.

I'm developing a database add form wich contains about 6 web pages. As we all know, you can read out variables from a previous web page containing a form, but if you go from there to te next page, you lose them again. To deal with this problem, I've inserted hidden fields on every webpage:
<input type="hidden" name="name" value="<? echo "$name"; ?>">
So the variables would be passed on from field to field.

When I reach the last page, I show all the variables inserted by the user over the 6 pages and the variables will be added into the database.

Because this is very complicated and doesn't always work, my question is, isn't there an easyer (better) way to do this?

Greetz Helgo Rongen
You can use Get-variables (add them to the url), that way you can also use normal links to proceed to the next page.

you can also use sessions and store the data in the session.

Greetz Daan
Hmmzz, I thought about adding them to the url, but I have a maximum of more than 100 variables........en it depends on what is added, because not every field is obligated to be filled out. Also, on some pages, you have the possibility to add a number of "things" all at once.

For instance: you're accommodation has 12 rooms, so you type in the field 12, en you get 12 fields with there own attributes.

Never the less, the idea of sessions sounds good to me, could you explain how this works???

Greetz Helgo.
on that page sessions in php are explained, its a LOT of info, but usefull.
The needed/available functions are located somewhere at the bottem of the page.

Greetz Daan
Tnx for the valuable information..........I'll check it out.

Greetz Helgo.