views:

44

answers:

1

I have a form with many inputs, but not all inputs must be filled in. Form action is set to a php file, which checks which inputs are set and builds a query to query MySQL.

Then I display the results on the main page, and the users may click on an ad to show.

When clicked an ad, a new page opens with several options for the user (change ad, delete ad, save ad etc).

On this page, I am currently struggling with a 'back to search results' button/link. I don't know how to do this. I thought firstly about the 'history.go' to just make a 'back' button, but if the users would use one of the options on the page then the 'back' wouldn't work!

Another way would be to somehow save the query in a hidden input and pass it to the 'show ad' page or something... But this seems unsafe as the query is visible to users!

Do you have any ideas or suggestions?

Thanks

+1  A: 

Save the data you need to build the query in the page. This could be a copy of the original form with all the input types converted to hidden.

David Dorward
David, could you please give me some more information about this? I don't really know what you mean, which page should I save the copy in? I should tell you it is alot of inputs!
Camran
You have a button marked "Back to search results". Make it a submit button. Wrap it in a form full of hidden inputs.
David Dorward