A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Prevent Duplicate Form Submission
Learn how to use PHP sessions to prevent duplicate form submission or re-submission.
On Tuesday, June 27th 2006 at 11:42 AM
By Jatinder Thind (View Profile)
(Rated 4.7 with 18 votes)
Modifying your form
Add this PHP code to the top of the form.php script:
In the PHP code above we create a unique ID using the uniqid() function and then create a 32 character hash of this unique ID using md5() function. Next we store this unique ID in the session for later use in the form-exec.php script. Remember to use a different session variable for each form.
Handling form submission
Compare the value of the hidden field with the value stored in the session. If the values match, process the form data. After processing the form data unset the value stored in the session. Now if the user refreshes the page, the form processing code will be skipped. See the sample code below.
|Digg It! Del.icio.us Reddit StumbleIt Newsvine Furl BlinkList|
Rate this tutorial
There are no related tutorials.
Related Source Code
There is no related source code.
PHP Job Search
From the creators of Geekpedia, a revolutionary new coupon website!
BargainEZ has coupons codes, printable coupons, bargains and it is the leading source of Passbook coupons for iPhone and iPod touch devices.