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

Interview question #2

This is related to PHP's array . An array has number of elements. All elements are integers and unique, which means there is no repetitive integers. (e.g.) $foo = array(7, 5, 9, 13, 2, 8); You have to sort the array, provided: You should scan the elements only once. You're not allowed to compare the elements when sorting. (i.e., you're not supposed to use any comparison operators) Sorted resultant array may not be the source array. How will you do that?

Nisaptham Trust - Address and PAN for 80G

Today (July 31st) is the last day for filing income tax returns. Donations to charity and political parties are exempted for tax under Indian income tax clause 80G . When it comes to donations, World Vision India used to be my choice because of their professionalism and prompt communications. Of late, having heavily impressed by Nisaptham Blogger 's writings about his charity work, I thought of sending meager amount to his charity Nisaptham Trust. Unfortunately, when I sent that in March, it was not a pleasant experience. I had to randomly follow him through email and WhatsApp to get PAN of Nisaptham Trust; he shared that PAN details after 3-months. When I try filing returns yesterday, it was another shock; apart from PAN, I also need to furnish the charity address. I quickly searched through Google and there were no results about the address; I can only find its bank account details. Google's autocomplete suggestions hinted the possibility of such queries by others thou...