Skip to main content

Track previous link of a site in PHP

I just spotted through Google that Raj Shekhar has quoted my post to comp.lang.php in his Blog Ideas page:

mr_burns wrote:
> Is it possible to get the previous url. For example, if I am on page
> page01.php - and I then click to - page02.php - from page02.php, can
> use script to determine that I have come from page01.php? It doesnt
> have to be the entire url, even just the file name. Cheers

Add this line in the beginning of every script or possibly using a
global-common include file say config.php

output_add_rewrite_var('referer', htmlspecialchars($_SERVER['PHP_SELF']));

Comments

Popular posts from this blog

Solved: "Ports" Tab Not Visible in VS Code (WSL2)

None of the solutions I found on Reddit or GitHub worked, and most of the related GitHub issues were locked. So I'm documenting this here for future reference. Problem When using WSL2 in Visual Studio Code, the Ports tab—needed to access your application in Windows browsers like Chrome or Edge—doesn't appear. Even the Ports-related options are missing from the Command Palette. Solution After a lot of trial and error, here's what worked: Run npx serve in the VS Code terminal. It will output a URL such as http://localhost:3000/ . Click the link (or use the Follow Link option). This will open the app in your default browser. You may notice that it opens on a different port (for example, http://localhost:64198 ). At this point, the Ports tab becomes available in VS Code. After this initial trigger, the Ports tab seems to remain available in future VS Code...

MBAs Vs Hackers

MBAs Vs Hackers war is always on and hackers win with creating Linux to Firefox internationally. But, in India, coding is always considered to be a lower end job . In the international hacker cult, they code, code and code even at their 60s. In India, MBAs always take a lead saying "anybody can code", so every programmer is forced to "switch" to leadership role. Another problem with India is that there is no "real hacker" comparable with International cult. I have been lamenting this for years and smelling the "gap" for years. I've consoled myself with "Learner, Hacker, Idiot" tag in LinkedIn profile. Recently I noticed some guys who branded themselves as hackers when they're bashing MBAs in Quora . Having impressed by their "attitude", I checked their product and found nothing better than StockFox . Some hacker chauvinistic links I'm fond of: The Hacker FAQ How to be a Programmer: A Short, Comprehensive, ...