سؤال

I have a reponse url "reponse.php" is which after a trasaction is done,the banks response is posted to it and inturn display the status to the user whether trasaction is succesfull or not.But the problem is,when user lands in this,the back button is active and user can click on it and go back.I do want to disable this back button.Any ideas?

هل كانت مفيدة؟

المحلول

The selected solution is wrong. This is not how to solve this problem. $_SERVER['HTTP_REFERER'] is not reliable. It can be spoofed and omitted which breaks this solution.

To prevent this you need to implement the POST/REDIRECT/GET pattern. Here is a tutorial that shows how it is done in PHP.

نصائح أخرى

Check for $_SERVER['HTTP_REFERER']. It will return you the document refered URL. With that URL you can give the condition and disable the button.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top