Passing HTML POST data to embedded <iframe>s

Author Message

Reinhard Hutter

Friday 10 August 2007 9:23:48 am

Hello!
I've got a site with quite a lot of external pages embedded into my site. Therefore I've created a content class "external_page" with attributes "title" and "url", which are embedded in my site with following (pseudo-) code

<h1>{$node.title}</h1>
<iframes src="{$node.url}" name="external_frame">

This solution allows me to nicely wrap my site's design around the external_pages. However, I now have to pass HTML POST data from my own pages down to embedded pages. I tried to achieve this by specifying the target-parameter of the HTML form-tag. E.g. on my frontpage I've got a search box

<form action="http://www.mysite.com/other_url" target="external_frame" method="post">
...<input>...
</form>

which calls "other_url" on my site with the embedded iframe I want to pass my data to.

However, it does not work, no data is passed down to the iframe. Sadly I'm also limited to method="post", GET-Parameters are all ignored.

Any hints available?

Thanks in advance,
Reinhard

Nicolas Lescure

Friday 10 August 2007 12:14:14 pm

Hi.

I really think you can't send post data to your iframe, only get parameters.

You will have to develop a little extension (module) which creates the post parameters returns the other web site page. You can do this with a javascript form or with AJAX (http://developer.yahoo.com/yui/examples/connection/post.html for example).

So, your iframe code should look like this:

<h1>{$node.title|wash}</h1> 
<iframes src="htt.p://www.mysite.com/makerediction/(url)/www.othersite.com/(param1)/value1/(param2)/value2" name="external_frame">

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.