SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member php-coder's Avatar
    Join Date
    Oct 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb How to load a web page in a div?

    I'm trying to load a web page in a div after clicking a button.
    How can i do that using php?

    I have tried with <?php include("file1.html") ?> , but this loads the file when the page is appeared on web browser.

    I want to load fil1.html in a div after clicking a button.

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,075
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    This is a perfect example of AJAX. http://www.switchonthecode.com/tutor...and-javascript is a simple example for ya.

  3. #3
    SitePoint Member php-coder's Avatar
    Join Date
    Oct 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Thank you k.wolfe .
    Is it possible using php(using include()) ?

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
     <form action="" method="get">
     <button name="showit">show it</button>
     </form>
    <?php
    if (isset($_GET['showit'])) {
        include 
    'file1.html';
    }
    ?>


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
  •