The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 22, 2019, 05:23:59 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: getting referer....  (Read 2359 times)
dee
Journeyman
***
Offline Offline

Posts: 94


View Profile
« on: October 31, 2008, 05:05:20 PM »

hi all

been a while...on tour..new baby...no sleep. Trying get back on track with php learning curve.

So.To the point. Im trying to display the referer url to visiter and then post back main refererl site URL as a link. For instance:

Person is bounced from :                   http://A.com/subpageA.com         to http://B.com.       
Page on B.com needs to display:        you got here from http://A.com/subpageA.com  to go to A.com click here"link"

heres the code ive to so far:

<?php
$referer = $_SERVER['HTTP_REFERER'];
$refererhome = $_SERVER['HTTP_HOST'];
$visitorsIP= $_SERVER['REMOTE_ADDR'];

echo "$referer";  //displays referer
echo "$refererhome"; // displays root of referer
echo "$visitorsIP";  // isplays ip address of user
?>

hope it all makes sense. Trouble is it doesnt seem to display referer unless its from same server?? Can anyone help please.

Cheers.

PS did a search as thought there might be script somewhere.couldnt find anything.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: October 31, 2008, 05:17:51 PM »

That's peculiar and sort of doesn't make sense... are you saying you only get the referrer if you come from the same *domain* or the same *server*?

So if you post a link to site B from site A, then on site B you simply echo out the referring page, you don't get anything at all?

Try echo "
", print_r($_SERVER, true), "
"; and see what all the server sees - there might be some other funkiness going on.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
dee
Journeyman
***
Offline Offline

Posts: 94


View Profile
« Reply #2 on: October 31, 2008, 05:26:23 PM »

hi Perkiset.Any good tunes lately?

Ok. So im trying to redirect a 404 to another url and then give the option to go back to the root of the referring site as a link. Think i got the right requests didnt i? It just doesnt work though unless its come from same server.




Logged
dee
Journeyman
***
Offline Offline

Posts: 94


View Profile
« Reply #3 on: October 31, 2008, 05:33:18 PM »

doh ! sorry...i meant same domain ! 
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: November 02, 2008, 04:18:54 PM »

Hey Dee -

Here's a link to a scratch track I did a couple weekends ago - I am experimenting with some House style music as exercises for my youngest son, who is learning to play guitar. Tracks like these are for him to practice his "ShickaWow" floppy-pick style playing - think 70's porno tunes and you're right there Wink I don't have a melody or a complete notion for it yet - it was to experiment with a "slapback" echo on the rhythm tracks and ambient background noise:

http://www.perkiset.org/graphics/__special/HappyHouse.mp3

Regarding your problem - have you tried this with several different browsers? It is the browser that makes the request and pushes up the referrer, a website really can't tell it to discard that (AFAIK). Do you have any other websites pointing at this new Site A? Try other browsers on links OTHER than your own and see what you get.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!