将iframe src参数传递给里面的代码

时间:2012-05-22 14:13:11

标签: php jquery iframe

我在src网址中有一个带参数的iframe,如下所示:

<iframe src="http://www.form-page.com?suppressRedirect=1&A=1841" width="271px" height="295px" scrolling="no" frameborder="no" allowtransparency="true" style="position: absolute;left: 0;z-index: 1000;padding-left: 5px;"></iframe>



我需要在“表单页面”中获取参数
有没有办法在php或jquery中执行此操作?

4 个答案:

答案 0 :(得分:2)

是的,在php中检查$ _GET数组

$_GET['suppressRedirect'];
$_GET['A'];

值应分别为1和1841

答案 1 :(得分:1)

您正在通过查询字符串传递参数,就像正常请求一样。

$_GET['suppressRedirect']; // = 1
$_GET['A']; // = 1841

答案 2 :(得分:0)

在index.php上,您可以获取这些参数的值,如:

$suppressRedirect = $_GET['suppressRedirect'];
$A = $_GET['A'];
// use these two variables as you like now

答案 3 :(得分:0)

您已经以通常的方式通过URL传递所有参数,即通过$ _GET变量!
所有参数都存储在超全局变量(数组类型)$ _GET。

在您的信息页中:

http://www.form-page.com?suppressRedirect=1&A=1841

假设您在index.php文件中接收这些参数为$_GET['A']$_GET['suppressRedirect']

OBS:PHP变量区分大小写:$_GET['A']$_GET['a']不同

相关问题