Results 1 to 3 of 3

Thread: Help: How to include(and show) a PHP page inside a DIV tag (of another HTML)

  1. #1
    Join Date
    May 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help: How to include(and show) a PHP page inside a DIV tag (of another HTML)

    How do you include a PHP page inside a DIV tag so that the page can be visible inside the block created by the DIV tag.

    <div id="middleBOX2"</div>
    <a href="http://..../xyz.php">Link</a>
    <img src="..." alt="..." />


    The above code gives a "link" to the new PHP page.. but can we include the PHP page directly into the html??



    It works with frames.. with one frame showing HTML and other showing*.php
    Last edited by thetestingsite; 05-22-2007 at 12:40 AM.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Something like this?

    Code:
    <div id="test">
     <?php include('test.php'); ?>
    </div>
    Assuming test.php was something like this (and not a full HTML page):

    Code:
    <?php
    
    echo 'This is a test';
    ?>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Something like this?

    Code:
    <div id="test">
     <?php include('test.php'); ?>
    </div>
    Assuming test.php was something like this (and not a full HTML page):

    Code:
    <?php
    
    echo 'This is a test';
    ?>
    Hope this helps.
    That is good if he would like the output of the php, if Mega would like to see the actual code you would need a little bit more work. you would need to replace all of the html special characters with their character entities so that it will not process the php script, but rather print it out

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
  •