user213559
user213559

Reputation:

Display previous page results when we click back button in browsers

I have an application in PHP which is a search form.If i make a search in the search box and i submit the form then a list of products will get displayed then if i click any product it goes to the product page,now what is my issue is when i click the back option in the browser an alert for re-submission is getting still i go previous page search results are not shown it is redirect to home page not to the search form also.

   Since i have list of variables i am using POST method instead of GET method.But if i use GET method there is no issue but i want to know whether the same can be in POST method also.

Upvotes: 1

Views: 1306

Answers (1)

Stefan Mai
Stefan Mai

Reputation: 23949

Use GET. There's a lot of debate about what qualifies for each of the HTTP verbs, but generally speaking this fits squarely in the GET world. The POST warning by the browser is unwarranted: the first sign that you shouldn't be using it for this particular operation (search).

Upvotes: 3

Related Questions