Re: best way to pass variables to <iframe>
| From: | Justin French | Date: | Wed, 29 Jan 2003 06:50:36 +0000 |
| Subject: | Re: best way to pass variables to <iframe> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133460@lists.php.net to get a copy of this message | ||
on 29/01/03 4:35 PM, Mantas Kriauciunas (Mantuks@attbi.com) wrote:
> I believe there was question like this, but I was wondering if someone
> could point me with useful information about passing variables to
> <iframe>.
To point out the obvious, you can pass variables to any URL by using GET:
<iframe src="page.php?var1=foo&var2=bah"></iframe>
iframes can be targeted with links just like a regular frame, using
target="frameName"
Other options would be to have variables stored in sessions, in cookies, or
via POST variables (I think).
But (to the best of my knowledge), since PHP is server-side, these pretty
much all rely on reading/acting on the variables whilst the page is being
processed and sent by the server.
I get the feeling you perhaps want to have an existing page in an existing
iframe react in relation to things happening elsewhere... correct?
I don't think it REALLY can, since once the frame's content is server-side,
it has nothing to do with PHP. You basically need to force the frame's
contents to refresh, perhaps with new variables passed in with either GET,
POST, sessions or Cookies.
Javascript can read cookies, but I don't think this is your answer at all.
You need to be more specific about what you want to achieve.
Justin