* Thus wrote Ashley M. Kirchner: > > PayPal passes a ton of data back to us when someone's done > purchasing something. I use some of that information and shove it all > into a database. Problem is, if someone hits reload on their browser, I > get the same data re-inserted again. Reload the page four times, and I > will get four records with the same data inserted. How can I avoid > this? I'd like to silently either discard the information after it's > been inserted, or silently prevent it from being re-inserted again. This is what I call the BRS (Browser Reload Syndrome: the tendency of idiodity users insisting on reloading a page unnecessarily.)
The basic solution with this problem is: 1. generate some sort unique id on original form 2. ensure unique id has not been entered when posted. In your case, paypal should be returing to you some sort of transaction Id, 'txn_id' iirc. So step 1 isn't needed. What you need to do is before you insert the data that has been posted to your script, is to ensure that that 'txn_id' has not been entered already into the database. > -- > W | I haven't lost my mind; it's backed up on tape somewhere. tar xf /dev/somewhere /your/mind; :) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php