I’m building some widgets for a charity. Due to some logo licensing malarkey, I’ve got to find some way of only allowing white-listed sites from running the code, or to send a error message (or something like that) rather than the widget.
We’ve got to use iFrames as a fair few sites have already embedded them.
Ideally, a PHP solution would be best, but JS is ok if needs be.
So, the one liner; Can I check the domain the iFrame is sitting in and send it different content?
I wonder what the chances are of being able to do this…
You can use the HTTP_REFERER header.