Code:file_get_contents(path_to_the_file);
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??
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
Nope, that don't work either:
"URL file-access is disabled in the server configuration"
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
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!
Where do I put my url in that example?
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
why not use an iframe?
Achieve IT - Web Design & SEO Galway
Hi, you can find out more info of how Google handles iframes here:
Frames - Webmasters/Site owners Help
Achieve IT - Web Design & SEO Galway