View Full Version : How-to iFrame in PHP?

10-18-2006, 08:31 PM
I want to install the tabbed document viewer into a PHP/mySQL page. I am an intermediate user of html and can generally handle simple cut and paste scripts. I have not yet learned PHP or CSS, but I need to get this application set up to permit the use of iFrame Document viewers throughout the site.

Can all pages using the document viewer source from the same CSS code? Or does each need it

How and where do I place the header information to allow for the body script to work as if it were in an HTML page?

10-18-2006, 09:04 PM
Place it at the desired position within the HTML output.

10-18-2006, 09:19 PM
$content = file_get_contents("file.htm");
echo $content;

10-18-2006, 09:23 PM
$content = file_get_contents("file.htm");
echo $content;
Where do I put this code?
Does this do all that the code for HTML does?
Then I just insert the iFrame body script is simply placed into the HTML output like I'm used to?

10-18-2006, 09:25 PM
Place it at the desired position within the HTML output.
In HTML, there is a script that must be included into the header as well. Does this script go, instead into the CSS? And if so, how should it be altered to allow it to work?

10-18-2006, 10:24 PM
PHP isn't all that complex, in theory.

It's just a language that ends up outputting html.

PHP echoes/outputs/etc EXACTLY where the command is called.*

1<?php echo "2"; ?>3
would become:

Therefore, just output the script where it should go in the html code... place the php right there.

*the one exception is with using an output buffer, which stores all output into a variable for later use, but you're not using one, and they are only applicable in specific situations... certainly don't worry about it now.

10-19-2006, 01:38 AM
Okay. Great. So, I place the code in the body of the source, but not between the tags that indicate the visible content to appear on the page. Does it matter where in the body code it is placed?

I also want to install a java applet script for a scrolling marquee and would like to place it into the PHP header panel so that it will show throughout the site. Is this basically the same process then? Or does Java have the "header" code?

10-19-2006, 02:03 AM
You may be interested is reading this (http://www.webtech101.com/index.php?page=essentials). This will help you undestand a little better about javascript. Basically, when modifying a PHP page with something like this it is best to not worry about the PHP. Figure out where the javascript,CSS, and HTML go in a regular page. Then worry about integrating it with PHP.

10-19-2006, 02:36 AM
One css for many ? yes u could
Just place the css link tag inside of <head></head> tag;

the sample:
<?php echo "
<link href="../../css/defa2.css" rel="stylesheet" type="text/css" />