Go Premium for a chance to win a PS4. Enter to Win


Going back to previous web page generated with a MySQL query fails in IE8

Posted on 2010-09-16
Medium Priority
Last Modified: 2012-06-27
I have three web pages we will call page1.php, page2.php and page3.php. Page1.php has a search box and allows the user to search a MySQL database which returns results in an automatically generated table displayed on page2.php. Page2.php has code to split results into pages of 25 result per page, and code to display both "next" & "prev" links, as well as hyperlinked pagenumbers. Someone can select a link on page2.php which goes to page3.php to play the requested video file. Page3.php has an embedded player and chooses to play a file based on information passed through the URL (http://www.website.com/page3.php?video=videoname).

The problem here is when a user selects the back button, or the javascript "return to previous" link on page3.php it goes back to "Webpage has expired" in IE8. The same pages seem to work in Firefox and in Safari on the iPhone, however it is critical it work in IE8.

I am at a loss.
  • 4
  • 3

Expert Comment

ID: 33695619
Check this out:

In the mean time, an idea is to open the links to videos in new pages using _blank as your target for now.

Expert Comment

ID: 33695650
You could try tucking this in the top of the results page too to see what happens:

<meta http-equiv="Pragma" content="no-cache">

Author Comment

ID: 33695750
I checked your link and it is for IE4 and states that the latest version of IE fixes the problem (evidently not), it also refers specifically to ASP which I am not using, but interesting information anyway. One other fix they mention is to go into internet options and adjust a setting, I can have every potential visitor do that so that option will not work for me even if it fixes the problem on my machine.

I tried your second idea with the meta tag, did not work.

I may try opening them in a new page if no one else has any ideas, I just really hate to do that.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Accepted Solution

trippy1976 earned 2000 total points
ID: 33703568
is this a secure page (https?)

Here is an article about this focused on PHP

I don't believe the issue is specific to IE8.  Your IE8 settings are probably "just right" for it to happen, but I suspect it could happen to anyone else with those exact settings on any other browser.  It appears to be due to caching.  Have you tried it using IE8 from a few other computers?

Here is the link:


Author Comment

ID: 33709932

No, this is not a secure page. I read the article you linked to and first off, I am not using sessions. Secondly, I believe the second solution is correct in that I am indeed using the $_POST command to get information for the page. The problem seems to be that the post data is lost in IE8, but not in FF.

The solution in the link you provided seems a little weird, I really don't understand why an "elegant" solution requires a third page, and what the third page really is.

Following my earlier discussion.... page1.php would contain the form, then I would pass the form off to page1a.php which would then process the form and display the data? Then what do I do with page2.php?

I could use a different method of sending the information to page2 from page1 which currently uses the POST command. The problem with that is I use a FORM to get search keywords which are then POSTed to page2 and processed from there. I am not sure how I can tell the form to pass a variable without using the POST command. Here is the current form:
   Search the short description field:<br />
   <form action="search2.php" method="post">
       Enter words to search for (leave blank to display all records):<br />
      <input type="text" name="keywords" size="20" maxlength="40" value="" />
      <input type="hidden" name="sqltype" size="1" maxlength="1" value="1" /><br />
      <input type="submit" value="Search!" />

Unless of course I used page1a to translate the POST data into GET data in the URL and could append that data to the location header? Something like this:

page1 - > keep existing form data except under action change page2.php to page1a.php
page1a - > use header('Location: http://www.website.com/\'.$ConvertedFormData.'\''); along with code to read the POST data and convert it to GET data in the URL
page2 -> convert to use GET data instead of POST data

Sound good? Can the header be below the processing code?

Author Closing Comment

ID: 33711254
I went ahead and tried it this morning and so far that seems to work fine. Here is what I did:

page1 - > keep existing form data except under action change page2.php to page1a.php
page1a - > use header('Location: http://www.website.com/\'.$ConvertedFormData.'\''); along with code to read the POST data and convert it to GET data in the URL
page2 -> convert to use GET data instead of POST data

using this code in page1a.php:
      $keywords = $_POST['keywords'];
      $sqltype = $_POST['sqltype'];
      $varpass = "?sqltype=".$sqltype."&keywords=".$keywords;
      header('Location: http://www.website.com/videos/search2.php'.$varpass);

I no longer the page is expired message in IE, it still seems to work in FF, and of course it never displays anything from page1a.php. Thanks!

Expert Comment

ID: 33717228
Another possible option, if you choose to use sessions, is to have page1 submit to page2, which is not a "page" but a script.  Have it take the $_POST information and tuck it into a session variable and forward to page3, which is the results page.  Page 3 can then use the variable in session and not the post information to generate the results.

The thing with $_GET[] is that it has limits and exposes data you may not want exposed.  Also, if you're going to use GET, you could just change the method on your form I think.

Anyway, hopefully you are making progress, thank you for the points.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question