![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
Senior Coder ![]() Join Date: Jul 2005
Location: UK
Posts: 1,051
Thanks: 6
Thanked 13 Times in 13 Posts
![]() |
Automatically Retrieve <title> of Referring Page
Hi all,
Title of the thread says it all really - I'm not even sure whether to be looking for a JS or PHP solution (my instinct is JS). Anyone have any ideas? Regards |
|
|
|
|
|
PM User | #2 |
|
Master Coder ![]() Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 5,244
Thanks: 4
Thanked 417 Times in 415 Posts
![]() ![]() |
So I assume you already are able to see what the referring page is?
You just want to grab the title? Or, are you thinking about opening a log file and reading in the referring URLs ... I'm not sure how you are seeing the referral URLs to begin with.
__________________
. |
|
|
|
|
|
PM User | #3 |
|
Senior Coder ![]() Join Date: Jul 2005
Location: UK
Posts: 1,051
Thanks: 6
Thanked 13 Times in 13 Posts
![]() |
Sorry, the referring URL is in the query string. I'm creating a bookmarking system where you have a button on your toolbar with this JS function:
Code:
javascript:location.href='http://www.example.com/bookmark.php?url='+encodeURIComponent(location.href)" EDIT: I've just realised I can probably encode the title at the same time as the URL. Doh! *potters off to try that out* EDIT: It works, kind of... These two functions work seperately to get the two bits of information I need: Code:
+encodeURIComponent(location.href) Code:
+encodeURIComponent(document.title) Code:
javascript:location.href='http://www.example.com/bookmark.php?url='+encodeURIComponent(location.href)'&title='+encodeURIComponent(document.title)" Last edited by Pennimus; 09-01-2006 at 02:11 AM.. |
|
|
|
|
|
PM User | #4 |
|
Senior Coder ![]() Join Date: Sep 2005
Location: Sydney, Australia
Posts: 2,275
Thanks: 0
Thanked 23 Times in 22 Posts
![]() |
You left out the + in href)+'&title
__________________
Stephen Helping others to solve their computer problem at http://www.felgall.com/ Web related ebooks and software - http://members.felgall.com/ Focus on Javascript - http://javascript.about.com/ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|