Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

How To embed HTML page inside PHP without an IFRAME

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

Moderator: daj

Post Reply
User avatar
K8POS
Posts: 94
Joined: Sat 03 Jan 2015 4:17 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 7
Location: Thumb of Michigan
Contact:

How To embed HTML page inside PHP without an IFRAME

Post by K8POS »

My coding knowledge is poor at best.


I have an HTML page that I want to place inside of a PHP page.
Right now I am using the <IFRAME> to do it. While it works, Iframe does have some draw backs.
I have tried using the INCLUDE function but it would not work.

Here is the raw HTML I am trying to place: http://www.melvinweather.com/gaugetest.htm

Here you can see it running in the IFRAME: http://www.melvinweather.com/template/indexDesktop.php

Here is the PHP file I am trying to embed the HTM in.

Code: Select all

<?php

	# 		Name
	# 		Namespace:		nameSpace
	#		Meteotemplate Block
	
		
	// load theme
	$designTheme = json_decode(file_get_contents("../../css/theme.txt"),true);
	$theme = $designTheme['theme'];
	
	include("../../../config.php");
	include("../../../css/design.php");
	include("../../../scripts/functions.php");
	
	$languageRaw = file_get_contents($baseURL."lang/gb.php");
	$language['gb'] = json_decode($languageRaw,true);
	$languageRaw = file_get_contents($baseURL."lang/".$lang.".php");
	$language[$lang] = json_decode($languageRaw,true);
	
?>
	

	
	
	<!-- BLOCK CONTENT -->


 <iframe src="http://www.melvinweather.com/gaugetest.htm"
        width="100%" height="590" frameborder="0"
        </iframe>
Any suggestions?

Bob
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: How To embed HTML page inside PHP without an IFRAME

Post by beteljuice »

It is unclear from the above if some the includes are true php (require processing) or are simply stuff that should be pasted in a html environment.

The easiest way to use html is to simply give it a .php extension, put in your usual html headers etc. and use
<?php
....
?>

In the required locations ;)
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply