how to avoid multiple submit button click??????

Discussion in 'PHP' started by sheriffonline, Mar 4, 2008.

  1. #1
    Hi,

    I have one registration form. there are 3 steps to complete the registration form.

    i complete the first step , second step and third step. while i do these steps i can go back edit the form. but at the final step complete and received signup success form and email the user can not access the previous steps. which should show page expired or can not be displayed.

    Please advice me with code.

    Thank you in advance.

    Sheriff
     
    sheriffonline, Mar 4, 2008 IP
  2. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sounds like a job for JavaScript, preferably AJAX. Can't advise you on how to do it, though, as I'm still getting the hang of it myself.
     
    Altari, Mar 4, 2008 IP
  3. able

    able Peon

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    When the final form is reached, store a session variable or cookie.

    On the previous pages, have them check the session or cookie, if it exists - display whatever you want.
     
    able, Mar 4, 2008 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    You can also meta refresh them to another page after the post is sent.
     
    Colbyt, Mar 4, 2008 IP
  5. nialler

    nialler Peon

    Messages:
    97
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've used both of the techniques that the others have mentioned. I would set a $_SESSION variable which gets once you register a user and check against it on the signup pages and as an extra measure I would forward them to another page after the one with that creates the user.
     
    nialler, Mar 5, 2008 IP
  6. bpasc95

    bpasc95 Active Member

    Messages:
    196
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #6
    I would suggest the following data flow on the submit:
    1. Person fills out data on form then hits submit.
    2. On the script side, process the data as you normally would.
    3. Once processing is complete, use a php header location redirect to the thank you or confirmation page.

    By doing this, the end user can hit refresh on the confirmation page and it will not resubmit the form data.

    If you are just looking to make the submit button go away, you can try something like this:
    http://www.dynamicdrive.com/dynamicindex11/submitonce.htm

    -Bing
     
    bpasc95, Mar 5, 2008 IP