• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Displaying PHP (phpBB, Coppermine) within an HTML page?

Rhombuss

Golden Member
I have an HTML page setup with a menu bar at the top going left to right. Is there any way of showing the PHP pages underneath the menu bar inside the HTML page?

I've tried iframes, but they don't scale vertically to the size of the forums, so it either gets cut off or shows an unwanted vertical scrolling bar.

Any ideas?
 
If the software is designed to be "swallowed" into other pages, then there should be a special .php file you can include into your page ( http://php.net/include ). If not, then you'll need to stick it in a frame (bleh) or try to work with its templating system (bleh too).

You might figure that just including the main page would work, but it would produce invalid html, and it would probably break things.
 
Thanks for the suggestion BingbongWongFooey. I'm not too familiar with PHP though, how would a simple include() function be used in an HTML document, if I just wanted it to display a single PHP file? I tried the HTML example in that link, but it didn't work for me.
 
Here's a post by a member of another forum that said he had a javascript that could resize the height of the iframe according to the content it contained:

I have managed to put together this code, which MANY of you were looking for. To the CODE!

In your page where the iframe will be contained, use the following code (add attributes more as needed):

<iframe id="dynamIframe">
---------------------------------------------
Now, in ANY page that is to be loaded into the iframe insert the following code (preferably between the <head> & </head> tags)

<script>
function resizeToContent(){
var x =0;
var y =this.document.body.scrollHeight;
while (x < y){
x+=1;
}
parent.document.getElementById("dynamIframe").style.height=x
}
</script>
---------------------------------------------
Finally, use the following as the body tag in the same pages as the javascript above:

<body onload="resizeToContent()">
---------------------------------------------
TADA! Hope this helped all of you guys out!


-os2


I tried it, but it didn't work - is the script bogus, or just some typo that I can't seem to find?
 
Originally posted by: BingBongWongFooey
It's a php function; you can't put it in html without putting it within <?php ?>

So would it be something like this?

<body>
<?php

include 'http://www.rubicon-design.com/tift/Forums/index.php';

?>
</body>

Still couldn't get it to work 😛

 
<body>

<? include "http://www.bla.com/this.php"; ?>

</body>

That's how I've always done it. If you add that to a .HTM or .HTML file though, it probably won't work. Most servers have PHP process files with .php or .php3 extensions only.
 
igowerf,

I got it to work - thanks. But when I run the site, all the images for the phpBB forum don't work. Is there something else I should know?
 
Back
Top