There is a php script that is executed by the user in the iframe , the Sprint is on one domain, and the iframe on another. I need to make a check on the user's domain, if such a domain exists, then the script is executed.
The problem is that not one $_SERVER element can not get the remote client domain. Except of course HTTP_REFERER . All the rest show information on the server on which the script itself is running (even REMOTE_HOST ).
client.ru
<iframe style="border: 0px; " src="http://server.ru/lib.php" width="100%" height="100%"></iframe> server.ru
$url = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST); $urlcheck = тут массив с урлами разрешенных клиентов; if ($url == $urlcheck) { echo = 'выполняем скрипт'; } I don’t really like HTTP_REFERER myself, because it can easily be changed, but how else can I check the client’s domain?