I am currently have i an iframe eg:
<iframe src="www.mydomain.com/myfram.php"> and embedded to my client page with different domain name.
i want my script in "myfram.php" to detect parent domain(client domain) where my iframe is embedded in.
I use
$_SERVRE['SERVER_NAME'] but it return my domain name not client. So do you have another ways to grab client domain.
I am currently have i an iframe eg: <iframe src=www.mydomain.com/myfram.php> and embedded to my
Share
PHP doesn’t even know that the page is in an
iframe. Only JavaScript can tell you that, and even then cross-domain restrictions may interfere.If anything will work, it’ll be using AJAX to send
top.location.hostnameto the server.