php file in htm page?

Discussion in 'HTML & Website Design' started by master_train, Mar 16, 2008.

  1. #1
    Hello

    I have in my site index page.htm

    i want to know how can i insert in a frame an .php file which when clicking a link in the php file it will open on the main page and not only at the frame where the php is in

    im using MS front page
     
    master_train, Mar 16, 2008 IP
  2. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #2
    <!--#include virtual="insertthisfile.html" -->
    Code (markup):
    That might work for you. Then add this to your links:
    target="_top"

    You may have to name your included file with the .shtml extension. And if the target="_top" doesn't break out... then add the following to your <head> of the included page:
    <head>
    <script language="JavaScript" type="text/javascript">
    <!--
    function breakout_of_frame()
    {
      if (top.location != location) {
        top.location.href = document.location.href ;
      }
    }
    -->
    </script>
    </head>
    Code (markup):
    Although... I would prefer to just rename your index to page.php and use a php include instead:
    <?php include("filename.html"); ?>
    PHP:
     
    scoopy82, Mar 16, 2008 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #3
    And if you choose to go down the PHP include route, my post PHP & Server-Side Includes [link: forums.digitalpoint.com] will show you how to do just that.
     
    Dan Schulz, Mar 16, 2008 IP
  4. master_train

    master_train Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Is there an easier way to do that?
    I tried to do that but nothing happen
    I guess im dumb at thing like that
     
    master_train, Mar 17, 2008 IP
  5. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #5
    Are you uploading these pages to your host ? It won't work from your computer.

    What exactly do you mean nothing ? Is the index page showing without the extra file ? Maybe you can point us to the URL so we can see better ?
     
    scoopy82, Mar 17, 2008 IP