Exercises, examples and other material relating to training module H307. This topic is presented on public course
|Articles and tips on this subject||updated|
|4627||Caching results in an object for efficiency - avoiding re-calculation|
Do you like to do the same thing time and time and time again? Probably not, as it's boring and inefficient. Computers don't get bored, but they can be inefficient if not programed well ... and because they don't get bored, they don't complain if they're inefficient.
Imagine you have a class of ...
|4136||How do I post automatically from a PHP script to my Twitter account? |
How can I now post automatically from a PHP script to my Twitter account? It was "all change" earlier this year as the old API was deprecated then removed, to be replaced by 1.1. This can do a lot, but there's a fearsome list of steps according to some of the documentation, it's not easy to follow, and ...
|4106||Web server efficiency - saving repetition through caches|
A thousand to one is an impressive increase in performance. And at times it can be achieved in web based applications if you employ caching.
Let's say that a user asks about... current train running on our First Great Western Coffee Shop site. They'll get a diagram like the one that's to the side here. ...
|4075||Further recent PHP examples|
Some more examples from another recent PHP course (PHP has been "flavour of the month" although I'm moving on to a fair chunk of Python training over the next few weeks as well!
Conditionals and loops - [here]
Regular and associative arrays - [here]
Application of PHP to web forms:
|4055||Using web services to access you data - JSON and RESTful services|
Rather than build database access directly into your application, you can write much more portable and maintainable code using a service / web service in which you embed the database access - or whatever else you're using for your backend data.
Web services are typically accessed through HTTP or HTTPS ...
|3999||Handling failures / absences of your backend server nicely|
It's good for your website to put a professional smile on it's face, even when it's having problems with its backend!
On high traffic sites (for example - TV show and news sites), backend servers can occasionally get overloaded and you'll want your web site visitor to get a message to that effect, ...
|3955||Building up from a small PHP setup to an enterprise one |
I've often described Well House Consultants as a "mom and pop" company - a small outfit where we provide a niche service (IT Training and a business hotel in Melksham). We make heavy use of PHP on our web sites, and it serves us very well, being quick and easy for us to code and running well on our ...
|3458||On this day ... one PHP script with three uses|
What happened on this day in previous years? What events in history, and what was the subject of this blog? As part of a demonstration (of caching), I wrote an example script that constructed a report ... but then I wanted to use it in various ways. As a demonstration page in its own right. As a ...
|3186||How to add a customised twitter feed to your site|
Twitter has become a useful flow of updating information - an alternative headline source from an RSS feed. How do you incorporate such a flow into your web site?
|3094||Setting your user_agent in PHP - telling back servers who you are|
If your web page pulls information in from other sites, you'll be turning your web server into a client (browser) to those other sites - and just as your web server can identify the type of browser it's answering via the $_SERVER[HTTP_USER_AGENT] variable, so can the remote server.
The default user ...
|3029||PHP data sources - other web servers, large data flows, and the client (browser)|
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 ...
|2545||Scraping content for your own page via PHP|
If your PHP allows for remote URLs to be handled / read as if they were files (and that's the default), you have useful tool which lets you include the content of one web page (or part of it) within another. For example, I can "scrape" the sections of a coming on a course page and insert them into ...
|2321||Uploading and Downloading files - changing names (Perl and PHP)|
When you are uploading a file to a server via http (in Perl or PHP), where is the file saved, and what is it called? And when you download a file, where is it saved on your local disc, and what name is it given? These are not unusual questions, but it can be hard to find the answer, as I was reminded ...
|2196||New Example - cacheing results in PHP for faster loading|
Here's an example from the last couple of days which is fully my own work, so I can share!
I was analysing a big data flow - yesterday's web log file in this case - and it was rather harsh on the server. No big shock about that - the log file's around 40Mbytes per day and I didn't have it in anything ...
|1995||Automated server heartbeat and health check|
Occasionally - very occasionally - we may have a problem on our public facing web server that's hosted in some network operation centre or other. It could be a software glitch, or it could be an internet connectivity issue. And we need to know about it quickly!
The problem is than none of us might ...
|1926||Flash (client) to PHP (server) - example|
Hidden deep in our website, there's an example of a Flash / Flex / Actionscript that runs in the browser, but contacts the server when certain information is required. In fact, it's so deeply hidden that I had trouble finding the links for some of yesterday's delegates:
An overview of Flash / Flex ...
|1812||Starting Ajax - easy example of browser calling up server data|
It works like this:
1. The original document called up from ...
|1813||Ajax - going Asyncronous and what it means|
This is the second part of an "easy Ajax" series - for the first installment [link here].
|1733||memcached - overview, installation, example of use in PHP|
Let's say you have a large database on a busy server, and queries that are eating into your resources. Would you like to be able to speed things up?
It usually turns out that there are certain queries which are very frequent and which return the same results each time (or for a period of time) which ...
|1647||Exchange Rates - PHP with your prices in your users currency|
Would you like to tell your user what your product will cost in his local currency? What a great idea, except that exchange rates change!
The European Central Bank, though, makes a file of exchange rates betweenthe Euro and other currencies avaialble abnd publicly accessible, and you can pick this ...
|1633||Changing a screen saver from a web page (PHP, Perl, OSX)|
Here's a challenge. I want to change the screen saver on a mac mini, running OSX, from a browser anywhere in the world.
You may well ask why ... the screen of the mac mini is to be visible at Well House Manor where it will provide an information screen at the front door when it's not otherwise in ...
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Calling in other online resources.
Databases and RSS feeds.
Making effiecient use of remote feeds.
Flash getting information from the server.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.