How can you stop users from using the back button or refresh button so they don't do thigs they don't want to do such as order something twice???
are you talking about the browser back or something else ?
You wouldn't. You'd attach a unique transaction ID to each shopping cart order, and ensure that no transaction is recorded twice.