I have a page in php that has some protection for hijacking a page(editing the browser URL address to go to another page), it compares some variables during the session & if there's an illegal entry, it redirects the user back to the home page.
I tried using 'header' for redirecting but it gives me this error:
Code:
Warning: Cannot add header information - headers already sent by....
Next I tried is javascript :
document.location.href='mainpage.php'
It works but .. for half a second before redirecting, the user can get a glimpse of the page, that's not supposed to happen. I noticed that this security issue can be noticed in konqueror but not in firefox browsers. In firefox the redirection is done without continuing to load the page.
Any suggestions on what other redirect codes I could use??
or probably some way to quickly stop the page from loading before redirecting?