How to go back on previous url with previous information using javascript function?

oie_T3Gdcr0TNur1.jpg am sharing some information here, maybe you will get this much space.Many times we perform such functionality in which the last information is lost if the URL is to be returned.Either we store them in the session or cookies or we pass and hold the parameter through the URL.It becomes a long procedure and the coding is not flowing according to the standard.

I am going to tell you what is going to be told to you, but many people who do not know and like me have been stuck many times, it will be very easy for them.You should do a simple method of JavaScript.

window.history.back();

Call it via OnClick at the place where you have given your back button.Many times, when you make this return, the page will kill and give an error of cache.

For which you can pass the header to the first file

header('Cache-Control: no cache'); //no cache
session_cache_limiter('private_no_expire'); // works
session_cache_limiter('public'); // works too

This is your simple method, you collect information and return. Mostly, it is a problem to submit the form to you, or if you have taken any action after doing search functionality.

Did you find this article valuable?

Support Shantun Parmar by becoming a sponsor. Any amount is appreciated!