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 8023335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:32:12+00:00 2026-06-04T22:32:12+00:00

acitvity.php //Form start <form action=”> </form> //Form End //Get POST Values <?php $_POST[”]; ?>

  • 0

acitvity.php

//Form start

   <form action=''>

   </form>

//Form End

//Get POST Values

<?php 

$_POST[''];

?>

//End

if i refresh the page after form is submitted, all the posted values are resubmitted, reason because all values are in browser so they are resubmitted. When i was searching solution for this, i got info that if the form & post operation done in separate php file then no more issue in posting values on refresh.

Is this the solutions? but now i have to do both in single file & POST values should not be submitted again on refresh.. is there any way to do this???

  • 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-06-04T22:32:13+00:00Added an answer on June 4, 2026 at 10:32 pm

    Learn PRG Pattern so that you can do this properly 🙂

    http://en.wikipedia.org/wiki/Post/Redirect/Get

    For example, you are trying to handle a user registration form, so what you do is you get a bunch of POSTed values, and save it into your database.

    if(!empty($_POST)) {
       // validate and save to db
    
       // get last inserted user_id
    }
    

    After you do that, instead of returning the same page with the previously POSTed values, you redirect the new user, for example to his profile page (assuming you have no activation requirement in place)

    if(!empty($_POST)) {
       // validate and save to db
    
       // get last inserted user_id, say in $user_id
    
       header("Location: /users/$user_id");
    }
    

    That way, the browser redirects and you won’t have problem with say, double registration, whenever the user hits refresh.

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

Sidebar

Related Questions

I have a form in index.php <?php echo '<form action=update_act.php method=POST>'; echo '<input type=submit
I am trying to get the div recentactivity to only refresh when Remove is
I am trying to start my VPN connection (using VPNC) from PHP. I have
I have a simple user signup form with a checkbox that lets users get
Can anyone tell me why this form does not properly submit values to server?
Pure, server-side PHP. Every time a user submits a form, I update a 'last
I have a page with the following structure: 1. Text 2. Form with SUBMIT
I always designed/developed/released a software or web project myself/independent activity using java/vb.net and php
'view_act.php' file <?php $query = mysql_query('select * from activities'); $check=mysql_num_rows($query); if($check==0) { echo No
I want to benchmark PHP vs Pylons. I want my comparison of both to

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.