Solved

IE8 Doesn't Refresh After Form Submission

Posted on 2010-11-21
5
707 Views
Last Modified: 2012-05-10
I have a simple form that has a few hidden fields and one file upload field.  It submits to itself (action="").  When the form is submitted, the php script reads the uploaded file, inserts some data into the database, then shows a summary of the info that was uploaded.  This works fine in all browsers except IE8.

In IE8, the file still uploads and the database gets updated, but the page does not show a summary of the uploaded info - it just shows the form again.  It is as though IE8 is caching the display of the page.

Is there any way to force IE8 to show the new version of the page?

Here is a summary of the code I am using.

<?php
if (isset($_POST['submitted'])){
    // Process the file
    // Update the database
    // Show a summary of the uploaded data
}
else { ?>
    <form name="frmUser" action="" method="POST" enctype="multipart/form-data"> 
    <input type="hidden" name="submitted" value="1" />
    FILE: <input type="File" name="csvupload" />
    <input type="submit" name="submit" value="SUBMIT" />
    </form>
    <?php
}
?>

Open in new window

0
Comment
Question by:jjjulie
  • 3
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34186007
Here is a different way to post to itself.  Maybe this will make IE think it needs to load a new page.
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 34186011
Try again.
<form name="frmUser" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">

Open in new window

0
 
LVL 30

Expert Comment

by:VirusMinus
ID: 34186129
you can do it with an empty action like this:

<form name="frmUser" action="" target="_self" method="POST" enctype="multipart/form-data">

Open in new window

0
 

Author Closing Comment

by:jjjulie
ID: 34186158
Thanks!
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34186163
You're Welcome!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS: Making responsive table look nicer 7 27
How do I pull the base url for use in html links 7 23
ASP server side get value 15 24
html Uncheck Checkbox 2 13
This article discusses four methods for overlaying images in a container on a web page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

831 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