Forums / Setup & design / Passing HTML POST data to embedded <iframe>s

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

eZ debug

Timing: Jan 18 2025 03:03:03
Script start
Timing: Jan 18 2025 03:03:03
Module start 'content'
Timing: Jan 18 2025 03:03:03
Module end 'content'
Timing: Jan 18 2025 03:03:03
Script end

Main resources:

Total runtime0.1489 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 588.9141181.6406
Module start 'content' 0.00740.0062 770.554794.4063
Module end 'content' 0.01360.1352 864.9609523.3750
Script end 0.1488  1,388.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.2441200.0002
Check MTime0.00130.8893200.0001
Mysql Total
Database connection0.00080.515810.0008
Mysqli_queries0.104870.41071410.0007
Looping result0.00181.20391390.0000
Template Total0.134890.610.1348
Template load0.00080.540610.0008
Template processing0.134090.026910.1340
Override
Cache load0.00050.360010.0005
Sytem overhead
Fetch class attribute can translate value0.00060.403710.0006
XML
Image XML parsing0.00020.136910.0002
General
dbfile0.00402.6630200.0002
String conversion0.00000.005330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs