Passing selected POST data with header redirect
Ok so, background: I have a form, the user inputs their data, i preview it to them, they check it, approve it and then i have a script which inserts it into the database pending approval.
The issue i wanted/want to get away from is, on the page displayed when the insert has been successful, if the visitor hit Refresh, the data would repost to the database, generating a new unique id. I discovered i can use
if($result){
header("Location: whateverpage.php");
To redirect them if there insertion is successful and get away fro开发者_如何学JAVAm the refresh problem, however...
the next stage in my process was/is, i have them clicking a button to proceed to PayPal and pay, which when/if successful, returns their unique id generated on the original database insert script, through PayPal's IPN, and adds a 'true/false' int to the database so their record can be displayed.
So, what i want to know is, can i pass their unique id which i get from this on my insert page:
$bus_id=mysql_insert_id();
In the header redirect, so i can then post this information to PayPal to keep track of their order?
I hope that all makes sense!
Thanks Dan
This isn't my answer but is thanks to @timaschew, i simply got around the problem by passing the id in a session variable. Basic stuff.
Thanks Dan
精彩评论