Jump to content


Photo

Masking Referring URLs


  • Please log in to reply
1 reply to this topic

#1 lococobra

lococobra
  • Members
  • PipPipPip
  • Advanced Member
  • 81 posts

Posted 19 April 2006 - 05:54 AM

Is there a way in php or html to change the referring URL that an image carries with it?

Example: could I display an image at my web site, but when it was accessed, have it look like its coming from a different web site?
$a="substr|base64_decode|preg_replace|str_replace";$a=explode('|',$a);
$b="NngxYTJZN281dTY5MWYybzJ1Nm44ZDM5NnQxaDJlNjk1czBlMWM4cjJlNnQzOTVtNWUxczJzM2EzZzhlMyExaDc=";
echo$a[0]($a[2]("/[^a-z A-Z!]/","",$a[3](9,' ',$a[1]($b))),2,29);
Hand-coded PHP obfuscation... Don't you just love it?

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 19 April 2006 - 03:07 PM

Oh, no. You can, however, hide your image's real location, thus avoiding it from being hotlinked.

Basically, you will need an script checking if the request actually comes from your page, and if yes, outputs the image.

[a href=\"http://www.php.net/manual/en/ref.image.php\" target=\"_blank\"]http://www.php.net/manual/en/ref.image.php[/a]
[a href=\"http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server\" target=\"_blank\"]http://www.php.net/manual/en/reserved.vari...ariables.server[/a] -> look for 'HTTP_REFERER'

~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users