•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,600 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,443 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1582 | Replies: 2
![]() |
•
•
Join Date: Sep 2007
Location: uk
Posts: 17
Reputation:
Rep Power: 2
Solved Threads: 0
Hi,
I have one issue on entering data into database twice. When user add some details on my website's form pages and click on submit then data is added correctly. But if someone hit refresh button again then it will add another duplicate entry.
Is there something in php i can do to avoid duplicate form entries. thanks
I have one issue on entering data into database twice. When user add some details on my website's form pages and click on submit then data is added correctly. But if someone hit refresh button again then it will add another duplicate entry.
Is there something in php i can do to avoid duplicate form entries. thanks
•
•
Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation:
Rep Power: 2
Solved Threads: 10
•
•
Join Date: Aug 2007
Location: Morrisdale, PA
Posts: 52
Reputation:
Rep Power: 2
Solved Threads: 5
You can set a session for this as well. Within the headtags place code to start and register the session:
Then within your form, place a hidden field:
<?php
session_start();
if (!session_is_registered("nextValidSubmission")) {
session_register("nextValidSubmission");
}
if (isset($_POST['emailAddress']) && $_POST['submissionId'] == $_SESSION['nextValidSubmission']) {
}
$_SESSION['nextValidSubmission'] = rand(1000000,9999999);
?>
Then within your form, place a hidden field:
<input type="hidden" value="<?php echo $_SESSION['nextValidSubmission'];?>" name="submissionId">
I keep hitting "escape", but I'm still here!!!!
:}
:}
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- What's better? Windows 2000 Server or Linux Server? (Windows Servers and IIS)
- Duplicate pages, need help! (PHP)
- DVD audio problem :@ (Windows NT / 2000 / XP / 2003)
- Checking for duplicates in a orderedered linked list (C++)
- Multimap or other ? (C++)
- Display problem! desktop looks shrunk (Monitors, Displays and Video Cards)
- MIDI is Choppy After Replacing Sound Card (Windows NT / 2000 / XP / 2003)
- Right click menu slow to show (Windows NT / 2000 / XP / 2003)
Other Threads in the PHP Forum
- Previous Thread: Help with php and this part of the code...?
- Next Thread: Need help with session in php.....


Linear Mode