473,698 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 17 '05 #1
3 5453
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" <en*****@pacbel l.net> wrote in message
news:2G******** *******@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.
|
|
Jul 17 '05 #2
Hello,

On 10/29/2003 02:12 PM, entoone wrote:
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.


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.

http://www.phpclasses.org/formsgeneration

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #3
entoone <en*****@pacbel l.net> wrote:
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.


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! =-----
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1749
by: dave | last post by:
Hi I have created asp pages to submit logs online. It is used generally to log from handset similar to iPAQ, Pocket PC. I have on html form and one submit button. On pressing submit , it redirects to other pages and inserts log into db. But the problem is when they press submit, it takes a little bit long to go next page so people press submit button 2-3 times and finally its insert duplicat records
2
5993
by: Pamela Chatterjee | last post by:
In my Web Form I have more than one Textbox for user input. If I hit enter to any Textbox its submitting the form. How can I prevent Form submission if users hit enter to the textbox? I want to submit the form only when user will hit submit button. Thanks for any help.
2
2262
by: Nick Bell | last post by:
I have a general form validation question. I know very little about javascript, a little more about PHP. Using yav (http://yav.sourceforge.net): <form method="POST" name=edit onsubmit="return performCheck('edit', rules, 'classic');" action="pages_edit_submit.php"> <input type="text" name="title"> <input type="submit" name="Save"> <input type="submit" name="Cancel"> </form>
2
3813
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load fully.
6
1937
by: Lloyd Dupont | last post by:
I have a web form with multiple part. I do want the user to click the submit button to post back, so I know which functionality was triggered. unfortunately, when the focus is any text box, if the user hit ENTER the form is submitted, how could prevent that ? thanks, ... Lloyd
14
2338
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36) {alert("Temperature entered is out of range."); return;} } I enter data into the first textbox and move the cursor to the second textbox. The function is properly called. Since textbox2 is empty, when I
17
5476
by: emma.sax | last post by:
Hi all, I have a form where we would like the user to input their email address twice, to ensure they've typed it correctly, as is found on most sign-ups I'm looking for a solution to the problem where a user (and me it has to be said) just either highlights the email address with their mouse (or Ctrl-A) and then Ctrl-C, Ctrl-P (or right-click copy, right-click paste) into the next field down.
0
6181
by: josephkorn | last post by:
Hi all. I have a problem in my website in trying to prevent a user from double submitting the form. I am calling a subroutine from my page_load event that passes in the commandbutton that I want to prevent users from being able to click twice. Everything is working great, except for one small detail. When my client-side validation fires, and is invalid, I see the red text that displays the error message, but the problem is that something is...
2
2846
by: APA | last post by:
Why does adding code to the form submit function using the RegisterOnSubmitStatement method prevent the server side event handler for the submit button from firing? This is completely useless. I need some custom javascript validation on form submit but why does is kill the submit button event handler? Submit buttons don't use __doPostBack so what is being effected?
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.