As always, I've written a sprinkling of new demonstrations amongst some well-trodden example during the
PHP course I'm presenting this week:
There's a really short example of how you can call up another server from your own server -
[here]. So much more can be made of the web by presenting and combining resources from many different sources - rather than just data off you own machine. We do it "for real" by collecting the current weather from the BBC to include in our
travel to Melksham page, and by collecting data about train running from railway sources for the graphic in the top left corner of our
First Great Western Passenger Forum.
I've extracted data from the large flows I'm generating from the server work I was doing last week - a good example of some of the low level PHP string handling functions
[here] (and you can see the incoming data to that
[here].
Finally, there are a few golden nuggets that you can get from the user's request that will help you tailor the page you send back to him - things like finding out where he's visiting your site from, and what language he prefers to read the response in. The sample program is
[here].
Run the page with user's browser information
[here]
Run the page that looks at another server
[here]
Run the page that extracts from a log fil
[here]
(written 2010-11-04)
Associated topics are indexed under
H307 - PHP - Web2 and caching [4075] Further recent PHP examples - (2013-04-28)
[4055] Using web services to access you data - JSON and RESTful services - (2013-03-29)
[3999] Handling failures / absences of your backend server nicely - (2013-02-08)
[3955] Building up from a small PHP setup to an enterprise one - (2012-12-16)
[3458] On this day ... one PHP script with three uses - (2011-09-26)
[3186] How to add a customised twitter feed to your site - (2011-02-27)
[3094] Setting your user_agent in PHP - telling back servers who you are - (2010-12-18)
[2545] Scraping content for your own page via PHP - (2009-12-21)
[2321] Uploading and Downloading files - changing names (Perl and PHP) - (2009-08-04)
[2196] New Example - cacheing results in PHP for faster loading - (2009-05-24)
[1995] Automated server heartbeat and health check - (2009-01-16)
[1926] Flash (client) to PHP (server) - example - (2008-12-06)
[1814] Javascript/HTML example, dynamic server monitor - (2008-09-28)
[1813] Ajax - going Asyncronous and what it means - (2008-09-28)
[1812] Starting Ajax - easy example of browser calling up server data - (2008-09-27)
[1733] memcached - overview, installation, example of use in PHP - (2008-08-02)
[1647] Exchange Rates - PHP with your prices in your users currency - (2008-05-19)
[1633] Changing a screen saver from a web page (PHP, Perl, OSX) - (2008-05-06)
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)
[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)
[653] Easy feed! - (2006-03-21)
[616] printf - a flawed but useful function - (2006-02-22)
[114] Relative or absolute milkman - (2004-11-10)
564a
Some other Articles
Rail services back to Radstock?Coincidence, or Conspiracy - a wrong email addressGet all your ducks in a row ... and they may turn into swans Liquorice allsorts and Dolly MixturesPHP data sources - other web servers, large data flows, and the client (browser)VAT rise in January - it is really up 14% not just 2.5%Server logs - drawing a graph of gathered dataCoding efficiency - do not repeat yourself!Learning to Program ... in PHP. Course examples.Testing the new pavement ready for Christmas