I'm using php function uniqid() for creating unique identifier for every order.
<?php $order_id=uniqid(); ?>
And below in form:
<input type="hidden" name="ordercode" value="<?php echo $order_id; ?>">
After submitting form, all data is recorded in mysql database, and user is redirected to payment. It's working ok, but: If I press "back" button in browser and return to order page, input named ordercode contains the old value! This is unwanted because "ordercode" must be unique in database to recognize the order when client will make payment. If I submit the form again, there will be 2 records in database with same ID. I guess this is caused by browser cache. If so, is there any way to force browser to refresh page when going back? Or is there another cause? Any suggestions?