Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

HTML page with iframe php??

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

HTML page with iframe php??

Post by ace2 »

Another member(thanks uncle_bob) gave me the BOM rain rain radar to add to my site.
My whole site is plain htm and this template has to use PHP.
I attempted to add it as a iframe but it doesn't display at all.
I do have it running as PHP
http://ace2weather.com/rain_radar.php
To display the rain radar, this line is added plus a php config page as well

Code: Select all

<?php include_once("RainRadar.php");?>
So can this be added in anyway into a htm style page??
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: HTML page with iframe php??

Post by steve »

Does something like this not work?

Code: Select all

<iframe src="RainRadar.php" width="100%" frameborder="0"></iframe>
Steve
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

It fails to load images..
http://ace2weather.com/rain_radar.htm
It might have something to do with the body

Code: Select all

<body onload="launch()">
So I'm not sure how to get this working......
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: HTML page with iframe php??

Post by steve »

The browser console says launch() is not defined.
Steve
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

steve wrote:The browser console says launch() is not defined.
That's the problem, to find a loader to execute the PHP page/script for HTML...
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: HTML page with iframe php??

Post by steve »

You don't execute PHP in a browser, the server does it. It has already been processed and converted to HTML. The missing function is JavaScript, not PHP. The problem is nothing to do with PHP. The function is missing because your <body onload="launch()"> is in the main page, but you are referencing the IDR.loop.v03.js JavaScript file, which contains the launch(), from your iframe. The iframe probably hasn't loaded at the time the onload is executed. You probably need to arrange to call launch() when your iframe has loaded.
Steve
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

This sounds like fun.
:groan:
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: HTML page with iframe php??

Post by mcrossley »

Can the main page even use code in an iframe?

I think the "launch()" needs to go in the iframe pages HTML.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

I'm not even sure that would work..RainRadar php doesn't even have a body tag.
These pages, scripts & configurations were provided by another user to me, he was not the creator.....
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: HTML page with iframe php??

Post by steve »

Presumably you've tried using the iframe onload event, and not been able to get it to work?
Steve
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: HTML page with iframe php??

Post by mcrossley »

RainRadar.php does appear create a full HTML page, with a head and body - I just looked at the source of the generated page in the iframe.

As the containing page is HTML 5, I think you may also need to use the iframe sandbox parameter 'allow-scripts' to allow scripts to run in the iframe page...
https://developer.mozilla.org/en/docs/W ... ent/iframe
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

I did try sandbox' allow-scripts in the iframe section, but I'm unsure how to set the iframe with a onload event.
With sandbox allow script I ended up with a single image and nothing more.
I tried a ajax style loader and enclosed in the iframe ID, but it would load the main page then would open part of the radar screen in full screen = messed up.

So how would I add the onload event to the iframe tag, I'm guessing with a bit of JavaScript!!
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
uncle_bob
Posts: 505
Joined: Wed 17 Aug 2011 2:58 pm
Weather Station: WeatherDuino Pro2
Operating System: 2008
Location: Canberra

Re: HTML page with iframe php??

Post by uncle_bob »

ace2 wrote: These pages, scripts & configurations were provided by another user to me, he was not the creator.....
Sorry about the lack of assistance I can offer with these scripts, I found them on the net somewhere and it was off a quite old site that was mainly broken. Lucky they do seem to mostly still work and I'm a total pleb when it comes to Web stuff :)
Interested in building your own Weather Station? Maybe check out the WeatherDuino Pro Project Here
Conder, Canberra Weather
Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: HTML page with iframe php??

Post by mcrossley »

I would add the call to launch() in RainRadar php
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: HTML page with iframe php??

Post by ace2 »

uncle_bob wrote:Sorry about the lack of assistance I can offer with these scripts, I found them on the net somewhere and it was off a quite old site that was mainly broken. Lucky they do seem to mostly still work and I'm a total pleb when it comes to Web stuff :)
And I do thank you for them, as BOM offer nothing for us Australians to users....
The pages works fine as a php, but I use htm hence this thread.
:)
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
Post Reply