I have iframes over various websites. In my js, I'm hitting against a php file in a different domain. Is there a way to get the domain name for the server on which my iframes are hosted. (This is to prevent others hitting against my php file).
Example.
I have a domain called www.domain.com
and another call www.phpscript.com
If my website is embeded in yahoo
. Is there any way that I can find out that my js calls are coming from www.domain.com
and not some dodgy website?
$_SERVER['REMOTE_HOST']
and $_SERVER['REMOTE_ADDR']
would not work in this situation, as REMOTE_ADDR
would provide the users IP and REMOTE_HOST
would return yahoo
.