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

x
?
Solved

IE8 Doesn't Refresh After Form Submission

Posted on 2010-11-21
5
Medium Priority
?
716 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 84

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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

Expert Comment

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

Featured Post

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.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

963 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