Bookmarklet that goes to a url and makes the referring url available as a variable for a script.
June 12, 2005 10:13 PM
Subscribe
I need a bookmarklet that goes to a specified (static) url and makes the url of the page I came from available as a variable for a perl or php script. I just want to be able to go to a page I've set up and have it record the page I'm got there from, but the apparently-useful-for-just-this-sort-of-thing http_referrer variable only works if i clicked on a link to get there, while I, in my hubris, would like to be able to type the address in manually from anywhere. But apparently I can't. So it looks like a bookmarklet is the next best thing.
The thing is, I've spent alot of time learning php and perl to get to the point that I even know enough to need this, but bookmarklets are javascript, and javascript is a nut that is resisting my efforts to crack. I'm working on learning this crazy new language cause I'd like to be able to function in it, but maybe someone here can throw me a line on this one in the mean time? Because really I'd rather be learning more perl right now and it seems like this would be mad simple if you know the stuff. For me its agony.
posted by 31d1 to computers & internet (5 comments total)
Of course, replace 'http://www.cnn.com/' with whatever static page you want. The location of the page you are coming from will be available as $_GET['ref'] in PHP, or similar in perl.
(Not tested, off the top of my head, etc...)
posted by Turd Ferguson at 10:36 PM on June 12, 2005