Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
how can i find previous visited url in php? i can find current visited url using this piece of code($_SERVER['HTTP_REFERER']). But i need to find last visited page url.

What I have tried:

JavaScript
$_SERVER['HTTP_REFERER']
Posted
Updated 18-Feb-22 5:35am
Comments
Suvendu Shekhar Giri 25-Oct-16 9:48am    
What's issue with $_SERVER['HTTP_REFERER']?
It should give the last visited url, isn't it?

1 solution

You are wanting to bypass browser security. If what you wanted to do was permitted than any page you go to could gather a great deal of personal information from you with you knowing or being able to stop it. Your browsing history is personal information. And valuable as a commodity.

You are allowed to get the referrer - and that's something allowed because it is often necessary - and basically happens anyway: the referrer's arguments, for example, need to be parsed and picked up in case data is being passed between pages (common practice) by the web developer.

Somewhat related - you cannot open a file on the client directly (by path and filename). The routines always require a popup and user interaction to prevent some very bad security consequences.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900