Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    438
    Thanks
    9
    Thanked 7 Times in 7 Posts

    Prevent from Submitting Again

    All,
    I am submitting a form to a page and when I refresh it I want to now allow it to to submit again. I know I get a pop up box and I can control the query part by setting a variable in getting the post variables but just curious if PHP had an easier way to do this to find it a page was submitted.

    Thanks in advance.

  • #2
    New Coder
    Join Date
    Dec 2010
    Posts
    61
    Thanks
    12
    Thanked 0 Times in 0 Posts
    if you are using if php ($_POST) use header to redirect you back to your page - just guessing without seing the code

    Code:
    header("Location: ./yourpage.php");
    
    ?php if ($_POST) {echo "Form was entered correctly";} ?>
    Last edited by CloudWriter; 12-08-2010 at 04:18 PM.

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,503
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Set a SESSION variable ...

    and check it each time before you display the form.

    Google: PHP SESSION TUTORIAL


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •