Page 1 of 1

How To embed HTML page inside PHP without an IFRAME

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

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

Posted: Sat 09 Dec 2017 1:40 am
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 ;)