I'm developing a php page that is the result of some php elaboration with parameters in taken from POST values. When I go to the next page and go back to the page that I'm developing, the browser asks me again to POST the data reloading the entire page. My problem isn't related to the multiple post request, but I want only to show page. What can I do this? Thanks! :)
Asked
Active
Viewed 388 times
2 Answers
1
Try this steps:
1) Save result of some php elaboration into session.
2) After POST request is submitted and result saved to session, redirect user to other page which will display the result.
3) On those page where user inputs data, clear the session storage before processing submitted data.
So, in fact you need something that is usually called 'Session messages stack'.

Bogdan Burym
- 5,482
- 2
- 27
- 46
-
i like this solution.. simple and useful.. i'll try it now! :) – Jayyrus Oct 26 '12 at 18:49
0
Use the Post/Redirect/Get (PRG) Pattern.

Abhishek Saha
- 2,564
- 1
- 19
- 29
-
I said exactly the same. And pure Post/Redirect/Get (PRG) Pattern will not help him is the result is too complicated to put it into $_GET params. But I won't downvote. – Bogdan Burym Oct 26 '12 at 18:21
-
I understand what you mean. But is it too complicated to pass values from one array ($_POST) to another array ($_GET) and pass it to url ? – Abhishek Saha Oct 26 '12 at 18:26
-
No, he means not to pass $_POST. He means to pass the result of calculations based on $_POST (As I understand). And who knows what is that result.. Maybe longer tha $_GET request max length... – Bogdan Burym Oct 26 '12 at 18:39
-