I'm using header('Location:' . $somePage)
in the PHP app I'm working on and it appears to be working correctly. However, every time I use that it adds to the browser history which is annoying. Specifically, some pages require the user to login before they can see that page's content. So if the user is not logged in, a login panel is presented and they are redirected back to the original page. Again, that is all working correctly. But the page is added to the history every time they log in so when they click the Back button, they may have to go through several (of the same) pages to get back to a previous page.
Is there any way to use header('Location:')
without adding to the history? Or is there some other method other than using header
?
I suppose I could do it via JavaScript but the problem with that is the app I'm working on is used by school students. And many of the schools' browsers have JavaScript disabled as a security measure.
Any suggestions?