boaz barkan
boaz barkan

Reputation: 147

pass iframe src parameters to the code inside

I have an iframe with parameters inside the src url like this:

<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>



I need to get the parameters inside of the "form-page"
is there a way to do this in php or jquery?

Upvotes: 0

Views: 2785

Answers (4)

Igor Parra
Igor Parra

Reputation: 10348

You are already passing all parameters through URL in the usual way, ie, via the $_GET variable!
All parameters are stored in the superglobal variable (array type) $_GET.

In your page:

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

It is supposed that your are receiving those parameters in the index.php file as $_GET['A'] and $_GET['suppressRedirect'].

OBS: PHP variables are case-sensitive: $_GET['A'] is distinct to $_GET['a']

Upvotes: 0

Vishal
Vishal

Reputation: 2181

On your index.php you can grab values of those parameters like:

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

Upvotes: 0

ContextSwitch
ContextSwitch

Reputation: 2837

Yes, in php check the $_GET array

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

the values should be 1 and 1841 respectively

Upvotes: 2

Rory McCrossan
Rory McCrossan

Reputation: 337713

You are passing the parameters via the querystring as you would any normal request.

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

Upvotes: 1

Related Questions