Page 1 of 2
HTML page with iframe php??
Posted: Wed 12 Aug 2015 3:24 pm
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??
Re: HTML page with iframe php??
Posted: Wed 12 Aug 2015 4:02 pm
by steve
Does something like this not work?
Code: Select all
<iframe src="RainRadar.php" width="100%" frameborder="0"></iframe>
Re: HTML page with iframe php??
Posted: Wed 12 Aug 2015 11:25 pm
by ace2
It fails to load images..
http://ace2weather.com/rain_radar.htm
It might have something to do with the body
So I'm not sure how to get this working......
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 7:22 am
by steve
The browser console says launch() is not defined.
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 8:58 am
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...
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 9:24 am
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.
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 9:48 am
by ace2
This sounds like fun.

Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 11:16 am
by mcrossley
Can the main page even use code in an iframe?
I think the "launch()" needs to go in the iframe pages HTML.
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 11:56 am
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.....
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 12:42 pm
by steve
Presumably you've tried using the iframe onload event, and not been able to get it to work?
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 12:48 pm
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
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 1:18 pm
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!!
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 1:35 pm
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

Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 1:41 pm
by mcrossley
I would add the call to launch() in RainRadar php
Re: HTML page with iframe php??
Posted: Thu 13 Aug 2015 1:42 pm
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.
