Dupe Prevent on Form Submit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • entoone

    Dupe Prevent on Form Submit

    I have an html form, that has fields and when the submit button is pressed,
    the information is transferred to a php file. Which then inserts the data
    into my sql database. How can I go about ensuring that someone isn't able to
    submit thier information twice, or to somehow have the database checked
    before inserting the information, to see if it's there already. I have some
    duplicates happening and would like to stop it.


  • s a n j a y

    #2
    Re: Dupe Prevent on Form Submit

    You can generate a random number and insert it into your html file as hidden
    form variable. So when someone submits the form you can check for that
    value. If someone just go back and hit submit again or did the page refresh
    after submitting you will get the same number.

    A more robust method would require checking against the database.

    sanjay


    "entoone" <entoone@pacbel l.net> wrote in message
    news:2GRnb.304$ VC3.160@newssvr 14.news.prodigy .com...
    | I have an html form, that has fields and when the submit button is
    pressed,
    | the information is transferred to a php file. Which then inserts the data
    | into my sql database. How can I go about ensuring that someone isn't able
    to
    | submit thier information twice, or to somehow have the database checked
    | before inserting the information, to see if it's there already. I have
    some
    | duplicates happening and would like to stop it.
    |
    |


    Comment

    • Manuel Lemos

      #3
      Re: Dupe Prevent on Form Submit

      Hello,

      On 10/29/2003 02:12 PM, entoone wrote:[color=blue]
      > I have an html form, that has fields and when the submit button is pressed,
      > the information is transferred to a php file. Which then inserts the data
      > into my sql database. How can I go about ensuring that someone isn't able to
      > submit thier information twice, or to somehow have the database checked
      > before inserting the information, to see if it's there already. I have some
      > duplicates happening and would like to stop it.[/color]

      There are ways and ways to prevent duplicate submission. Some require
      sophisticated session variable schemes to detect when a form is being
      submitted more than once.

      If you want just to prevent that nervous users to click on the submit
      button more than once, you may want to try this class that among other
      things it can let you specify a message that will appear in alert that
      will ask the user if he really meants to submit the form again. This has
      been helping to prevent a lot of duplicate submissions.



      --

      Regards,
      Manuel Lemos

      Free ready to use OOP components written in PHP
      Free PHP Classes and Objects 2026 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


      Comment

      • PenguinsAnonymous

        #4
        Re: Dupe Prevent on Form Submit

        entoone <entoone@pacbel l.net> wrote:[color=blue]
        > I have an html form, that has fields and when the submit button is pressed,
        > the information is transferred to a php file. Which then inserts the data
        > into my sql database. How can I go about ensuring that someone isn't able to
        > submit thier information twice, or to somehow have the database checked
        > before inserting the information, to see if it's there already. I have some
        > duplicates happening and would like to stop it.[/color]

        Sounds like you mean protection against a boucing
        mouse click in which case a great solution already
        suggested. Make it visual!

        The best solution also covers someone that comes
        back a day later. Do a select based on some column
        you have like user name or email address? There
        is always the opportunity for mis-spelling though.
        If they are already in the DB put up a message.
        As said there are lots of varying degree solutions.
        And none really unique to PHP :) from what I see.
        -Walt

        --
        Reply to innkeepATcapita lDOTnet to email questions.


        -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
        http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
        -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

        Comment

        Working...