Hello All,
Here is the issue. I have a search form posting to a page where I query a db and display results...
When I hit the "back" button on my browser it always comes up "page expired", which I then have to hit "refresh" and click "ok" to the js pop up box. How can I prevent that from happening?? So that when I hit "back" it simply loads the previous pages results...
I am using a very simple mod_rewrite for SEO freindly URL's, would that cause this issue?
Thanks in advance
Using Post
Moderator: General Moderators
Not sure what SEO friendly URL's are, but...
The way I got around your problem was having a next and previous button with my form and using a session to store the data from the previous page. Pressing the previous button would save all the data in the current page to a session variable and go to the previous page, which automatically checks to see if there's any data for each field in either $_POST OR $_SESSION.
The way my form works is that the "next" or "submit" button parses all the data back to the same page via $_POST and then validates the data and if all the data is ok, it's added into a session. The only drawback is that you have to make sure that none of the input fields in the input form on any of the related pages have the same name...but that shouldn't be difficult to achieve!
Hope this helps.
Don't have any code on me at the moment to post up sorry.
The way I got around your problem was having a next and previous button with my form and using a session to store the data from the previous page. Pressing the previous button would save all the data in the current page to a session variable and go to the previous page, which automatically checks to see if there's any data for each field in either $_POST OR $_SESSION.
The way my form works is that the "next" or "submit" button parses all the data back to the same page via $_POST and then validates the data and if all the data is ok, it's added into a session. The only drawback is that you have to make sure that none of the input fields in the input form on any of the related pages have the same name...but that shouldn't be difficult to achieve!
Hope this helps.
Don't have any code on me at the moment to post up sorry.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Cache control settings in the response header. Look at header().
MCCCY005 -
instead of mypage.php?var=value would be mypage.php/value/
I was trying to avoid having to add a "next" or "back" button due to the fact most people press the "back"button on thier browsers so didnt want to rely on a "breadcrumb" back button. The way you explained was my original process so thank you for the reply...
however,
Everah -
Thanks for the direction to the header() function, I was able to fix my issue by using $_POST and adding the above code.
Thanks all for the replies
This is what I mean by SEO freindly URL's:Not sure what SEO friendly URL's are, but...
instead of mypage.php?var=value would be mypage.php/value/
I was trying to avoid having to add a "next" or "back" button due to the fact most people press the "back"button on thier browsers so didnt want to rely on a "breadcrumb" back button. The way you explained was my original process so thank you for the reply...
however,
Everah -
Code: Select all
session_cache_limiter('private');
session_cache_expire(30);Thanks all for the replies