Forum Moderators: coopster

Message Too Old, No Replies

Copy HTML content of iframe

Programmatically copy the HTML content of an iframe for reinclusion.

         

wildbest

1:32 pm on Apr 20, 2006 (gmt 0)

10+ Year Member



Generally, the idea is to programmatically copy the HTML content of an iframe or multiple iframes on a web page. I want to substitute the iframe tag and its content with their own HTML content and generate a new instance of the web page but this time without the iframe. Anyone come up with a common PHP solution?

hakre

6:22 pm on Apr 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi wildbest,

i don't know the setup of the site in specific but would suggest you the following:

1.) convert iframed-pages from html into xhtml files (if not already done)

2.) since xhtml is xml, you just use the xml libraries of php to read in the file and extract the party you need (i guess the body) of it.

3.) re-use the extracted part todo whatever you like with it.

does this sound like a solution to you?

wildbest

7:45 pm on Apr 20, 2006 (gmt 0)

10+ Year Member



...does this sound like a solution to you?

Of course, hakre! Thank you. May be people call this AJAX? :)

How do I convert from iframe into xhtml dynamically so that conversion is updated periodically?

hakre

8:50 am on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



May be people call this AJAX?

Nope. AJAX is just another word for DHTML in short which came a bit out of fashion because of web standards. AJAX does sound a lot better and is more DOM based. Compability Probs stay the same with DHTML anyway: Javascript needs to be supported.

Anyway with PHP you're able to solve such and other problems on the server side which makes your site just far more cooler. If you're really after AJAX you can put it over the top anytime afterwards soon enought so just forget about it right now.

How do I convert from iframe into xhtml dynamically so that conversion is updated periodically?

i don't understand what you mean by talking about "a conversion from iframe to xhtml".

to do things periodically on your server use cronjobs, that's not a prob at all in general. checkout your webhosting features and demand cronjobs if not avail.

wildbest

3:43 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



I'm simply quoting your suggested steps:
1.) convert iframed-pages from html into xhtml files (if not already done)

Any reference where I can see an example of such a script would be appreciated.