1

Currently working on a nice three step order form for a wedding photographer, so guests can order pictures.

I've set the form up in 3 steps.

1.user details 2. review order 3. confirmation

What's the best way to repopulate the form data if the user goes from Step 2 back to Step 1.

I initially thought of using sessions to pass the data back, though I have a feeling this is probably incorrect.

Any tips would be awesome.

Thanks all.

k to the z
  • 3,217
  • 2
  • 27
  • 41
eagleworks
  • 67
  • 1
  • 2
  • 6

2 Answers2

2

I would do it using the session variable. What other alternatives do we have? You could provide those values in every GET or POST request the user sends to the server, but that's not a really good idea, I think. Other alternatives? Instead of saving those values in the session variable, you could temporarily use a datebase. I would stay with using the session variable.

Flinsch
  • 4,296
  • 1
  • 20
  • 29
  • I think I'll give it a go with sessions, store the POST data in the session on step 2, check if it exists on step 1 then repopulate. Thanks for erasing my doubts with sessions. – eagleworks May 09 '11 at 15:52
0

I ran into this problem on my project. I first started with sessions. I ended up storing them in temporary tables. I clean those tables out after the last submit on the confirmation and then put that data into the permanent tables. To identify a record I just pass an alias back and forth that is fed into a parameterized query that selects their record in the temp tables.

k to the z
  • 3,217
  • 2
  • 27
  • 41