I have a store which works like this:
The problem is, a simple refresh causes an empty table to be sent per email. How can I prevent this? Can I redirect somehow after the execution of the mail function? So the thank you page doesn't do anything on refresh?
You can do by calling the PHP header()
function like this:
header('Location: thankyou.php');
exit;
The user will be redirected to the thankyou page and a reload there will not execute your code again.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.