How to clear browser history?

Hi all,
I want to clear the user’s browser history, after a certain task is completed…

Or if it is not possible, then at least i want to prevent the user to go back by clicking the browser back button…

How can i achieve it…

Thanking you for your help regarding this…

You can’t.

Or if it is not possible, then at least i want to prevent the user to go back by clicking the browser back button…

You probably could use javascript to disable the back button for some users, but don’t do that. I myself would never visit a site again that disables things in my browser.

Why don’t you explain why you want to do this. Someone might have a great alternative.

I have a page, generated an pdf file with an id that is collected from database and increased to one and display that in the pdf file…

After generating this, if the user interests on that pdf, he may send the request to email that pdf as an attachment to him, by clicking on the button send request…

After sending the request, the details of the user and requested pdf file id will be stored in the database for further use…

If, user goes back by clicking on the browser back button, and he reload the pdf file generated page, at that time with same content another pdf file will generate but differs the id.(because id is now increment by one.)

How to prevent the users to do this?

As guido says you can’t clear the browser history with php (and being in a php forum that seems to be what you’re asking). PHP runs purely on the server to generate text output which is passed to the webserver which then outputs it as a webpage. It doesn’t directly communicate with the browser like the webserver does and even the webserver can’t wipe the browser history.

I don’t think javascript will be able to wipe the history either though its always possible you might find some ultra cool hack with enough googling… even then I doubt it would be cross browser.

If it were me I would create a unique URL to the pdf file in question. Once its been read you disable the url or forced download and simply display a message saying that the url is no longer valid and if you require access get in touch kind of thing.

Thanks for all,
I got solution for this, in an another way…

hi i am facing same problum like you can you tell me what solutation you found

please do this ASAP

Thanks

I didn’t clear the browser history…
I keep track the IP Address of the user’s for 2 min…
And check if the same request is generated by same IP address user, it will not redirect to their specific page, giving the message…

It can’t be done - read my previous explanation.