Results 1 to 9 of 9

Thread: How-to iFrame in PHP?

  1. #1
    Join Date
    Oct 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How-to iFrame in PHP?

    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?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Place it at the desired position within the HTML output.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <?php
    $content = file_get_contents("file.htm");
    echo $content;
    ?>
    - Mike

  4. #4
    Join Date
    Oct 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mburt
    Code:
    <?php
    $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?

  5. #5
    Join Date
    Oct 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    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?

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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:
    123

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Oct 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  8. #8
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    You may be interested is reading this. 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.

  9. #9
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    One css for many ? yes u could
    Just place the css link tag inside of <head></head> tag;

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •