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 ... | 2016-01-20 |
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 ... | 2013-07-15 |
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. ... | 2013-06-08 |
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!
PHP basics:
Conditionals and loops - [here]
Regular and associative arrays - [here]
Application of PHP to web forms:
First ... | 2013-05-04 |
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 ... | 2013-04-06 |
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, ... | 2013-02-08 |
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 ... | 2013-01-05 (longest) |
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 ... | 2011-09-27 |
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?
There are Javascript widgets which you can incorporate into your page, available from twitter (so much less prone to spec change than a third ... | 2011-03-04 |
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 ... | 2010-12-18 |
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 ... | 2010-11-04 |
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 ... | 2010-01-06 |
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 ... | 2009-08-04 |
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 ... | 2009-05-26 |
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 ... | 2009-01-16 |
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 ... | 2008-12-06 |
1814 | Javascript/HTML example, dynamic server monitor There are times I want to keep an eye on our servers, but I don't really want to redraw my whole browser window (or even a frame!) to do it. So I've written a Javascript application to run in my browser (source code here) that calls up a tiny piece of PHP on the server (source code here) and replaces ... | 2008-09-28 |
1812 | Starting Ajax - easy example of browser calling up server data Ajax (Asynchronous Javascript and XML) provides a very neat way for a web page that's displayed on a browser to interact with a web server and replace just part of the page content without the need to reload the whole HTML document or Frame.
It works like this:
1. The original document called up from ... | 2008-09-28 |
1813 | Ajax - going Asyncronous and what it means This is the second part of an "easy Ajax" series - for the first installment [link here].
In the first installment, I showed you a "bare bones" example in which Javascript on a browser called up a web service to change information being displayed dynmaically - but I couldn't reall call it Ajax (more ... | 2008-09-28 |
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 ... | 2008-08-02 |
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 ... | 2008-05-19 |
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 ... | 2008-05-07 |
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.
Ajax and Javascript validation.
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses 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.