get the parent url of iframe in PHP

前端 未结 6 1200
梦毁少年i
梦毁少年i 2021-01-19 12:38

I am creating a widget that would load in a IFrame and users will be able to place the widget on their own website. How would I get the URL of the website that is using the

6条回答
  •  长发绾君心
    2021-01-19 13:00

    I have also tried to echo "$_Server[referrer]" in the IFrame page and that did return the IFrame parent URL, but how easy is it for someone to manipulate the referrer variable?

    Pretty easy, but so is disabling JavaScript! However, if a web site uses your