Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

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: 93
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 » Fri 08 Dec 2017 10:57 pm

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: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

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

Post by beteljuice » Sat 09 Dec 2017 1:40 am

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