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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:23:06+00:00 2026-06-02T04:23:06+00:00

I have a form in dashboard.php to create invoice and this is submitted to

  • 0

I have a form in dashboard.php to create invoice and this is submitted to invoice.php

Now my invoice.php inserts the Invoice and the customer into the database and then shows me a invoice order filling form.

if i refresh this page, it inserts a new invoice for the same customer, how do i avoid this.

I was reading that we could avoid it by redirection, but in my case how do i use it. Some thing like a PRG(post/redirect/get) how to use it?

Do i need to make an intermediate page before going to insert items to invoice

  • 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-02T04:23:08+00:00Added an answer on June 2, 2026 at 4:23 am

    after successful form submission do a redirect to the same page and optionally indicate that the submission was successful

    Example: invoice.php

    if (count($_POST)) {
    
        if (/*post data is valid*/) {
    
            /*do whatever is needed*/
            header('Location: invoice.php?success');
        }
    } else if (isset($_GET['success'])) {
    
         echo "Form successfuly submitted";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form that pops up in a modal window like so: <?php
I have form in my page, I am using ajax.beginform(). Inside this form I
this is action url: http://localhost/carsdirectory/users/dashboard . dashboad.ctp (i have select filed and in this
I want to make a dashboard page with on top a create action (form)
I have form: <?php while ($row = mysql_fetch_array($result)) { echo <form action='login.php' method='POST'>; echo
I have form in my html page <form id=login_form method=POST action=index.php> <table> <tr> <td><label
I have form and some fields and I want send these fields to the
I have form area in my view. If I click button A , I
I have form that displays several keywords (standard set of choice lists that changes
I have form with 1 button. when you click on the button 3 others

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.