Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Remote Include Files?

  1. #1
    Coder reverbstudios's Avatar
    Join Date
    Apr 2008
    Location
    Leitrim, Ireland
    Posts
    50
    Post Thanks / Like

    Default Remote Include Files?

    I'm trying to find a way to remote include a file on each of my client's websites that displays a footer crediting my website. I need this footer code to be readable by Google. So far I've tried remote PHP Include which was perfect until the shared host turned off this function! Then I tried Javascript which worked fine but apparently Google can't see it.

    Need another option thats sorts the above problems??

  2. #2
    Senior Member louie's Avatar
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    2,423
    Post Thanks / Like

    Default

    Code:
     
    file_get_contents(path_to_the_file);
    :. Web Design & Development Web Design Ireland
    :. Search Engines Optimization Search Engines Optimization
    :. Car Parts & Accessories Car Parts
    :. Cars Ireland Cars Ireland
    :. I Have 2 Find It Directory SEF Directory

  3. #3
    Coder reverbstudios's Avatar
    Join Date
    Apr 2008
    Location
    Leitrim, Ireland
    Posts
    50
    Post Thanks / Like

    Default

    Nope, that don't work either:

    "URL file-access is disabled in the server configuration"

  4. #4
    Senior Member louie's Avatar
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    2,423
    Post Thanks / Like

    Default

    then try CURL.
    If that doesn't work, change hosting company...
    :. Web Design & Development Web Design Ireland
    :. Search Engines Optimization Search Engines Optimization
    :. Car Parts & Accessories Car Parts
    :. Cars Ireland Cars Ireland
    :. I Have 2 Find It Directory SEF Directory

  5. #5
    Wannabe Geek php.allstar's Avatar
    Join Date
    Apr 2009
    Location
    Monamolin, Gorey, Co. Wexford
    Posts
    405
    Post Thanks / Like

    Default

    Well here's how I handle remote includes with cURL in PHP:

    <?php

    function includeFileV2($url) {

    // Initiate the curl session
    $ch = curl_init();
    $timeout = 5;

    // Point curl to the irl we want
    curl_setopt($ch, CURLOPT_URL, $url);

    // Set some cURL options
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

    // Get the file contents
    $file_contents = curl_exec($ch);

    // Close the curl session
    curl_close($ch);

    $content = implode('', array($file_contents));

    // Return the content
    return $content;

    }

    ?>

    Sorry for not wrapping this in php bb code, but its just not working for me on this forum, keeps stripping my variables!

  6. #6
    Coder reverbstudios's Avatar
    Join Date
    Apr 2008
    Location
    Leitrim, Ireland
    Posts
    50
    Post Thanks / Like

    Default

    Where do I put my url in that example?

  7. #7
    Senior Member louie's Avatar
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    2,423
    Post Thanks / Like

    Default

    the example given it's a function, therefor you can add it to a common include file in the header of your website, then when you want to display your message you call it

    echo includeFileV2(url_to_page_here) ;
    :. Web Design & Development Web Design Ireland
    :. Search Engines Optimization Search Engines Optimization
    :. Car Parts & Accessories Car Parts
    :. Cars Ireland Cars Ireland
    :. I Have 2 Find It Directory SEF Directory

  8. #8
    Developer
    Join Date
    Mar 2009
    Location
    Galway
    Posts
    120
    Post Thanks / Like

    Default

    why not use an iframe?
    Achieve IT - Web Design & SEO Galway

  9. #9
    Wannabe Geek php.allstar's Avatar
    Join Date
    Apr 2009
    Location
    Monamolin, Gorey, Co. Wexford
    Posts
    405
    Post Thanks / Like

    Default

    Quote Originally Posted by reverbstudios View Post
    ...I need this footer code to be readable by Google...
    Now SEO is not one of my strong points and I stand to be corrected but I don't think content in iFrames is indexed by Google.

  10. #10
    Developer
    Join Date
    Mar 2009
    Location
    Galway
    Posts
    120
    Post Thanks / Like

    Default

    Hi, you can find out more info of how Google handles iframes here:
    Frames - Webmasters/Site owners Help
    Achieve IT - Web Design & SEO Galway

Page 1 of 2 12 LastLast

Similar Threads

  1. Hotel Listings - What to include?
    By blacknight in forum Webmaster Discussion
    Replies: 24
    Last Post: 12-04-2011, 03:15 PM
  2. Rate Cards, what should I include ?
    By paul in forum Monetisation Tips & Tricks
    Replies: 9
    Last Post: 22-06-2007, 05:26 PM
  3. PHP Include (Most Recent HTML File)?
    By ButtermilkJack in forum Coding Help
    Replies: 6
    Last Post: 29-03-2007, 09:19 AM

Visitors found this page by searching for:

remote include

remote includes

html include remote file

include remote html

html remote include

curl remote include

include remotehtml include remotehtml include remote htmlinclude remote html in htmlseo including filesудаленный includehtml include syntaxphp include remote htmlremote include html &lt;script&gt;php remote include curlphp include remote urlhtml remote include an html includecurl remote file inclusion#include remoteinclude remote webiste html can i put a php file on an html page remote -addtypehtml remote includesremote include htmlhtml includes remote

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •