1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP include query...problem with HOST

Discussion in 'PHP' started by ian_ok, Feb 16, 2005.

  1. #1
    Hiall,

    What is the difference between:

    
    <?php
    include './menus/top_menu.html';
    ?>
    
    PHP:
    &

    
    <?php
    include('http://www.mydomain.com/menus/side_menu.html');
    ?>
    
    PHP:
    The reason I ask is....

    The one with the full path doesn't work on it's own, but if I use the 1st version then any other includes with the full path will work.

    If I just use the full path thoughout it doesn't work.

    Also I don't want my host to say the 1st option works fine, when I could loose SE ranking as it is better to always give a full path.

    Using PHP Version 4.3.2

    Any feedback welcome

    Ian
     
    ian_ok, Feb 16, 2005 IP
  2. Josh

    Josh Peon

    Messages:
    893
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The reason the full path wouldn't work, would be because your host disabled including remote files for security reasons.

    Its always best to use the local filesystem anyway, because if you use the full HTTP path, then the server doesn't know its your server, and actually makes an HTTP connection to the URL, which takes longer.

    Search engines can't detect anything about php, as does humans.. its all processed on the server end. Either one wont have any difference as far as SEO goes.


    Josh
     
    Josh, Feb 16, 2005 IP
  3. iktorn

    iktorn Peon

    Messages:
    66
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    another thing is that you can't include "working php" from another server - you will get pure, parsed html.
     
    iktorn, Feb 16, 2005 IP
  4. ian_ok

    ian_ok Peon

    Messages:
    551
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is a reply from my host.....

    Dear Customer,

    Further to the issue you raised with php :

    You are using a construct include 'http://......'
    This results in php having to request the included file via http and generate a file in \windows\temp.
    As you are passing no variables to the php included page I would recommend using a file include e.g. include './menus/top_menu.php' -
    This would be more efficient and also would not cause so many temp files to be generated in the temp dir. "

    Can any shed any light on how true this........OR not.

    Thanks Ian
     
    ian_ok, Feb 16, 2005 IP
  5. iktorn

    iktorn Peon

    Messages:
    66
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ian:
    I think it is true. If you don't have to, don't use http://...
     
    iktorn, Feb 17, 2005 IP
  6. Josh

    Josh Peon

    Messages:
    893
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ya.. as I said before, PHP is server side, and as long as it works, NOBODY will be able to see the source, including search engines, so it will make no difference.


    Josh
     
    Josh, Feb 17, 2005 IP