I’m trying to write some code that various sites will embed, calling a script on my server. That script streams the binary data for an image and spits it into an image tag.
However, I’m trying to control who has access to that script. So if I hand out my embed code to, say, yourwebsite.com, I want to make sure the client requesting this script got it from “yourwebsite.com”.
Any suggestions?
Have you tried
$_SERVER['HTTP_REFERER']?This will work most of the time but please take the fllowing into account: