Want to provide sites that work close along side you with a feed of your blog? In recent versions of PHP, you can include a remote file from their server in your page. Here's a little example that's on our site - we're pulling down a piece of PHP via a URL.
Want the latest news from Well House Consultants? Read
<?php include("http://www.wellho.net/hml.inc"); ?> on
"The Horse's Mouth".
If you've PHP 4.3.0 or later, and allow_url_fopen is allowed, then the above example should work for you and give you a link where the text will change each time I post a new article on "The Horse's Mouth".
Both the site offering a service such as this AND the user site need to be aware of the security implications; our hml.inc file is open to anyone to read (and so must NOT give away secrets like passwords), and the user site must trust their supplier to be competent not to compromise their security. But with closely linked sites, it can work well.
Note - the included file must NOT have a parsed extension such as .php ... otherwise it will be run on the site offering the service rather than being shipped down to the user site..
This is a working example, so you can see the source code through the URL shown above. I've also indexed it and you can see it
here in our
resource library (written 2006-03-21, updated 2006-06-05)
Associated topics are indexed under
A301 - Web Application Deployment - XML, DTD, XSLT, XHTML and More [2554] Adding retrospective ALT attributes to IMG - (2009-12-28)
[2378] Handling XML in Perl - introduction and early examples - (2009-08-27)
[2246] What difference does using the XHTML standard really make? - (2009-06-18)
[1901] XML, HTML, XHTML and more - (2008-11-23)
[1050] The HTML++ Metalanguage - (2007-01-22)
H109 - PHP - Input / Output [3424] Divide 10000 by 17. Do you get 588.235294117647, 588.24 or 588? - Ruby and PHP - (2011-09-08)
[3159] Returning multiple values from a function call in various languages - a comparison - (2011-02-06)
[3029] PHP data sources - other web servers, large data flows, and the client (browser) - (2010-11-04)
[2964] An introduction to file handling in programs - buffering, standard in and out, and file handles - (2010-09-21)
[1780] Server overloading - turns out to be feof in PHP - (2008-09-01)
[1442] Reading a file multiple times - file pointers - (2007-11-23)
[1113] File and URL reading in PHP - (2007-03-20)
[1096] Sample script - FTP to get a file from within PHP - (2007-03-01)
[1094] PHP fread - truncated data - (2007-02-27)
[997] Most recent file in a directory - PHP - (2006-12-18)
[709] Handling huge data files in PHP - (2006-05-04)
[616] printf - a flawed but useful function - (2006-02-22)
[114] Relative or absolute milkman - (2004-11-10)
W603 - Web and Intranet - Server Side Technologies [2282] Checking robots.txt from Python - (2009-07-12)
[2055] Effect on server when memory runs out and swapping starts - (2009-02-26)
[1749] Using server side and client side programming together - (2008-08-11)
[1615] PHP training courses every month - (2008-04-18)
[1554] Online hotel reservations - Melksham, Wiltshire (near Bath) - (2008-02-24)
[1365] Korn Shell scripts on the web - (2007-09-25)
[1355] .php or .html extension? Morally Static Pages - (2007-09-17)
[1031] robots.txt - a clue to hidden pages? - (2007-01-13)
[1020] Parallel processing in PHP - (2007-01-03)
[732] Where is a web site visitor browsing from - (2006-05-24)
[642] How similar are two words - (2006-03-11)
Some other Articles
The ternary operator in PythonThink about your design even if you don't use full UMLCan some food be TOO different?Making use of disabled facilitiesEasy feed!Morning PostPlease Register with Opentalk - but just once!A person of few wordsDenial of Service ''attack''West Wilts Railway Users Group and trains to Lacock