将变量从iframe传递到WordPress站点


pass vars from iframe to wordpress site

我在一个域中有一个 iframe。

<iframe src="www.dsfsdfdsf.com/s_usr.php?currentuserurl=http://www.sddsd.com&currentuser=test" />

其他域(Wordpres 站点)上的s_usr.php:

if (isset($_GET["currentuser"])) { $currentuser = $_GET['currentuser']; }
if (isset($_GET["currentuserurl"])) { $currentuserurl= $_GET['currentuserurl']; }
if (isset($_SERVER['HTTP_REFERER'])){ $url = $_SERVER['HTTP_REFERER']; }
if (isset($_SERVER['REMOTE_ADDR'])){ $ipaddress = $_SERVER['REMOTE_ADDR']; }

源站点给出带有错误 403 的 iframe

似乎无法通过 iframe 发送 vars thro iframe,如果我只是添加没有 vars 的页面,iframe 就可以

<iframe src="www.dsfsdfdsf.com/s_usr.php/>

那么我该如何发送它们呢?也许WordPress否认这一点?

简答主持人:"调查您的问题,您似乎被我们的模组安全阻止了"

如果 iframe 的源位于其他域中,请在 src 属性中包含该域:

<iframe src="http://yourdomain.ex/s_usr.php?currentuserurl=http://www.sddsd.com&currentuser=test" />

还要检查 iframe 中包含的页面的 x-frame-options 标题。如果值为 DENY,SAMEORIGIN 则不能将页面作为 iframe 包含。如果是这种情况,您应该将选项设置为:允许发件人: 您的域这里