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

BehaviorS.js - An alternative to Behaviour.js, event:Selectors and Low Pro libs for unobtrusive JavaScript programming

BehaviorS.js yet another unobtrusive JavaScript library similar to Behaviour.js and event:Selectors but in implementation uses hash based lookup without extending elements; so presumably it should be faster than the rest. The original script and idea was by JLof ; I extended it for DOMContentLoaded support, optimized a bit to avoid scanning of more depths, and added new rules support. I wanted to document the plug a long time and just got time to do it. For the time being BehaviorS.js is available here Update (2006-09-11) : Coralized the link to BehaviorS.js so as to save the load on free brinkster.com webpage Update (2006-09-27) : If the coralized link to BehaviorS.js doesn't work, use http://www21.brinkster.com/guideme/BehaviorS/ Update (2025-06-07) : Now available in https://github.com/rrjanbiah/behaviorsjs

"A to Z of C" in the book Cimple (ISBN 0070260982)

I was just searching "A to Z of C" in Google Books and found that the book Cimple written by Sasant K Rout has used our code. The irony is that the book was published by Tata McGraw-Hill , who rejected us in final stage stating that it wants us to get endorsement from any IIT professor, which we couldn't. (For the sake of record... IIT Bangalore was linking & supporting "A to Z of C" for long time once it's published over the net; see old IIT page from web.archives.org ) It's just another incident to prove that success isn't a measurable unit; even failed attempts can be appreciated in any other forms.

Storing unicode texts in MySQL with phpMyAdmin

Today, I've received a personal mail/request from Sivanantham Hemamalini, working for IT leisure in Singapore. Since I was in company when received the mail, I couldn't answer immediately. If I understand the question right, it is about inputting Unicode texts especially Tamil in phpMyAdmin. PhpMyAdmin 's default characterset is iso-8859-1 and so if we enter anything in the form, browser will convert it into numerical html entities. Say for example, if we enter தமிà®´் and submit the form, it will convert it to & #2980;& #2990;& #3007;& #2996;& #3021; . Because of this browser's behavior, it will be difficult to store the Unicode text as it is. Solutions Immediate solution I could think of is changing or forcing the browser's character encoding into utf-8. In Mozilla Firefox, it can be set via View -> Character Encoding -> Unicode (UTF-8) Another elegant solution might be changing the phpMyAdmin configurations so that it send...