WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: andro700 on April 07, 2022, 03:02:46 PM
-
Is there a way to run two different radar status scripts with two different radar sites? Just wondering
Chuck
-
Yes. But.. you can't just include() a differently named copy of the script (you'll get a fatal error when the second copy tries to redefine a function defined in the first copy).
You may have to use it like readfile('https://your.website.com/radar-status.php?nexrad=RRRR&inc=Y&show=active');
where you'd like the second one (radar RRRR) to appear on the page.
-
Where would I put that in the script?
Chuck
-
You don't put it in the radar-status.php script. You put it on a wxsomename.php page script where you want to display a second radar site status.
-
For example, in a copy of wxnewpage.php (I called wxradarstatus.php) you can put
<div id="main-copy">
<h1><?php langtrans('Status of Nearby Radar Sites'); ?></h1>
<p>Our local site<br/>
<?php include_once("radar-status.php"); ?>
</p>
<p>Sacramento area<br/>
<?php readfile("https://saratoga-weather.org/radar-status.php?nexrad=KDAX&inc=Y&show=active"); ?>
</p>
<p>Hanford area<br/>
<?php readfile("https://saratoga-weather.org/radar-status.php?nexrad=KHNX&inc=Y&show=active"); ?>
</p>
</div><!-- end main-copy -->
to display the three radars.
-
Will work on it tomorrow. Thanks for the help.
Chuck
-
Got it up and running here https://www.goblesweather.com/wxradarstatus.php (https://www.goblesweather.com/wxradarstatus.php)
Another question. Is there any way that you can put in the radar page? https://www.goblesweather.com/wxgr3hanisklgx-dbZ.php (https://www.goblesweather.com/wxgr3hanisklgx-dbZ.php)
Chuck