Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    4
    Member #
    3477
    I have done a search on this site, as well as raround the web and everything I have found has not worked.
    What Im trying to do is call an external html file to put it in as part of my main page.
    I have created a simple script as follows, this code would be put inside a cell:

    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    Calling external html
    <?php
    include("http://www.gthing.net/blog/blogger.html");
    ?>
    </BODY>
    </HTML>

    I have tried it naming the file with both .html and .php extensions.
    With the php extension, the page source does not even show the php code. With the .html extension, the code is shown but it does not work.

    My server does have php enabled.

    For my failed attempts see:
    www.gthing.net/test.php
    www.gthing.net/test.html

    What am I missing?

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    It should be saved as .php and included like so...

    PHP Code:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    Calling external html
    <?php
    include "http://www.gthing.net/blog/blogger.html";
    ?>
    </BODY>
    </HTML>
    If that doesn't work try using relative file referencing...

    PHP Code:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    Calling external html
    <?php
    include "blog/blogger.html";
    ?>
    </BODY>
    </HTML>
    JR

  4. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    4
    Member #
    3477
    hallelujah!!! Using the relative referencing method it finally worked. You rule man! thanks!

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    No problem
    JR

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    As I understand it, PHP Include won't work with absolute URI referencing because it assumes that all URL's are relative to the file system path (which is also why you can't simply include "http://www.google.com"; for instance.)

  7. #6
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    you could also Use SSI if you want instead of PHP
    <!--#include virtual="http://www.gthing.net/blog/blogger.html" -->
    and make the extention .shtml or .shtm

    People don't actually ever use the true power of SSI sadly it is actually pretty impressive considering such a simple language

  8. #7
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    137 times
    They're all correct. If it's a page on your site, there's no real reason to include the whole link, you'll only need the relative file reference. FYI, I believe the term "external html page" refers to an HTML file stored on another web site, not on yours.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com