I have a bunch of sites with links in the footer that are all the same. I want to set something up so I can update all of the links from one place. I was thinking maybe like a text file that I update, and all of the sites read the text and pull the links from it, or something. I would do an iframe, but then I cant track clicks, so that wont work. Any advice would be great. Thanks
footerLinks.php (the file on the master server, which all other sites can access) <?php echo '<a href="http://google.com">Google</a>'; echo " | "; echo '<a href="http://who.is">Whois</a>'; ?> PHP: footer.php (the file that holds the footer information right now) <?php ... echo file_get_contents("http://location.us/footerLinks.php"); // Gets the footer file from the master server ?> PHP:
Why did you make footerlinks.php a .php file? It could as easily have been .html and probably would do about the same thing. Also, if you have everything on one server, you can use the require_once() function with a relative file path to include the file.
That could slow down page load because server has to download the footer first. You should implement a cache system that saves footer in a local file and displays from there until it expires.