Jump to content


Photo

http_referrer


  • Please log in to reply
3 replies to this topic

#1 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 01 August 2006 - 03:31 PM

umm
im using http_referrer variable to check where the user had come from but currently it displays
http://s12.invisionf...0
is there any way i can stirip out the index.php?showtopic=358&st=30&#entry4204164 ect.stuff from websites

#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 01 August 2006 - 03:41 PM

Something like this:
$referrer = $_SERVER['HTTP_REFERER'];
$ref_array = parse_url($referrer);
$domain = $ref_array["host"];

Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#3 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 01 August 2006 - 03:52 PM

umm yes i can get that but i dont want to rip off /desi_gfx because invision free hosts forums and i wanna see which forum they've come from

#4 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 01 August 2006 - 04:00 PM

Ok so just add
$path = $ref_array["path"];
$the_bit_you_want = $domain . $path;

Lookup parse_url function right here:http://www.phpfreaks....parse-url.html
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users