Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7098157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:01:12+00:00 2026-05-28T11:01:12+00:00

Possible Duplicate: Avoid resending forms on php pages Index.html <form method=post action=demo.php> <input type=text

  • 0

Possible Duplicate:
Avoid resending forms on php pages

Index.html

 <form method="post" action="demo.php">

             <input type="text" name="fname"/> 
             <input type="text" name="lname"/>
 </form>

demo.php

 <?php
       $firstname = $_POST['fname'];
       $lastname = $_POST['lname'];
       //some more php code to fill the webpage
  ?>

So the user enter his first name and last name and submits the form and then demo.php does its job and its working fine, but when I press F5 or refresh demo.php the next time I get this pop up from the browser

     // this message is from google chrome
     the page that you're looking used information that you entered.
     Returning to that page might cause any action to be repeated.
     Do you want to continute?

    // this message is from IE 7 or 8
    To display the webpage again,Internet Explorer needs to resend information
    you've previously submitted. If you were making a purchase, 
    you should click cancel to avoid duplicate transaction,else click retry.

Why do I get this? I want to just refresh the page. I don’t want that message to be popped out from the browser. Just refresh the page according to previously submitted values because its creating duplicate values in my database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:01:12+00:00Added an answer on May 28, 2026 at 11:01 am

    You need to respond with an HTTP redirect, the recommended flow is to process the POSTed data then redirect to another page with an internal identifier of the data processed.

    If you refresh a webpage that has just return from a POST, then the expected behavior is to make another POST with the same values as the last time.

    The header function can be used for that purpose in php http://php.net/manual/en/function.header.php

    To keep the state in the redirection you can use php $_SESSION or passed the data in the query string of the redirected URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What are the best practices for avoid xss attacks in a PHP
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C#
Possible Duplicate: Why avoid increment (“++”) and decrement (“--”) operators in JavaScript? I've heard
Possible Duplicate: How to avoid “!= null” statements in Java? Share your thoughts..
Possible Duplicate: why in some scripts they omit the closing php tag ?> As
Possible Duplicate: Java floats and doubles, how to avoid that 0.0 + 0.1 +
Possible Duplicate: PHP: Check who had read sent email? I'm writing a tool in
Possible Duplicate: PHP pagination class are there any PHP/Class libraries that i can utilize
Possible Duplicate: How to avoid scientific notation for large numbers in javascript? Hi All,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.