Training, Open Source Programming Languages

This is page

Our email: • Phone: 01144 1225 708225

For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
PHP module H309
Maps, Graphics and Geographics
Exercises, examples and other material relating to training module H309. This topic is presented on public course PHP Techniques

Articles and tips on this subjectupdated
4655Image indexer / thumbnail display scripts in PHP
I often say that example programs provided to show "how to" become too complex too quickly - going straight from the simplest of programs (a.k.a. a "hello world") though to something much more complex in a single leap. I take multiple steps as I proceed on our courses, and I try to make sure that I ...
4437Adding a PHP build option, rotating an image based on camera data, and a new look at thumbnails in PHP
A real pleasure to do a bit of image manipulation in PHP, and to install an extra module onto our PHP web server. Not common tasks, but ones we have to do occasionally. Summaries ... Installing the exif module onto my existing PHP. Note that each build updates config.nice so that adding an option ...
4365The changing face of Christmas
Christmas day was spend queitly at home - or, rather, mostly at home. A couple of brief trips of 6 miles each way to Devizes to pick up dad and bring him around for a Christmas Dinner, there being no bus service to use either one way or the other, which is what we do for most visits. I cooked most of ...
3027Server logs - drawing a graph of gathered data
You can log pretty much any server data on a Linux or Unix system at regular intervals using a crontab job that adds a line onto the end of a file. That crontab job could be as simple as a shell command, or it could be a bash or perl script (the two most natural languages to choose for such a task) or ...
4178Where are you? How to write a geosensitive application
Where are you? A question a web server will want to ask of a browser or app client, especially on mobile devices. And modern browsers, through Javascript, can send that vital information to the server. It's really useful in a wide variety of geographic data feeds - I've been working on a prototype listed ...
3817Fpdf - generating .pdf documents easily from your PHP program
You can generate .pdf files from within a PHP page using the fpdf module which you can download from It's quick to grab, easy to set up (pure PHP), and free of charge / royalty. Until today's PHP Techniques course, it was just one of thousands of modules that I know are out there, ...
3734QR codes with marketing logos embedded
I've been rather interested to notice a number of QR codes turn up recently in which there's an icon representing the site. Turns out not to be part of the standard library we use, but achievable through a handful of sites. Here are some "marketing" QR code: The redundancy within the code is reduced ...
3584QR codes - graphics images that provide quick phone links
You'll have seen these printed "QR" codes turning up on printed documents such as railway timetables, brochures and business cards, and they allow you to wave your phone at the pattern and have a copy of the document (or other details) come up there in electronic form. How do they work? QR codes are ...
3536UK Mapping Data - and more to come - under government Open Data measures
Data that's been paid for by the taxpayer should be available to the taxpayer / public. Seems obvious, but it hasn't actually been the case in many instances. But in the last few months, the Government's Open Data measures have been moving us along towards more public availability of data that ...
3447Needle in a haystack - finding the web server overload
*Something* on our web server has been causing the loading to rocket a couple of times a day recently, and it's been a bit of a problem to find out what that something is. Rather like searching for a needle in a haystack - except that when you find something that you think may be the problem, you can't ...
3211Computer Graphics in PHP - World (incoming data) to Pixel (screen) conversion
If you want to draw a diagram or chart on your web page, using data held on your server, chances are that the co-ordinates of the data won't match the pixel numbers that you're using on the screen. A case in point - on this week's PHP Techniques Workshop was a file of data for the years 2005 to ...
3197Finding and diverting image requests from rogue domains
Search engines search images as well as text these days - and our images are often picked up because we're "good boys" and label them with alt attributes. Good - that helps generate traffic. However, there are some image search engines which have a tendency to be used for, and to feed out, adult material, ...
1390Converting from postal address to latitude / longitude
Do you sometimes find odd gaps in new procedures you follow - "I can see everything I need to do to make X happen, except" ? I hit one of those yesterday. When learning how to interface to Google maps ... all the information was there, except there was no way that I could spot to click on a map and ...
3133An image from a website that occasionally comes out as hyroglyphics
Do you have an image that displays perfectly in your browser when you download it from your website ... ... but you get occasional reports from users that it comes out as a string of hyroglyphics for them ... The problem may be that the server isn't sending the right content-type header, and that ...
2939Protecting your images from use out of context
If you want to prevent your images from being "hotlinked" from someone else's site ... why not feed them out via a PHP script that checks the referrer? ... If you've arrived at this article via "", you should see a clean image - and the image is at the url "". ...
2729Uploading a document or image to its own URL via a browser
One of the major requirements of a committee / working group such as the TransWilts Community Rail Partnership is to be able to share information - and a forum (such as Simple Machines) does that admirably. So after yesterday's meeting, I put up a forum for our initial work. But one of the side issues ...
2675Redirecting to your main domain for correct security keys
Do you want to come to Well House Manor as a base to see Wiltshire or for a course? If it's you're first visit you'll want to find us on a map - and we have a map at which you can zoome to five levels at the click of a button and do other smart things with. And that ...
2583Reducing image size on digital photos - PHP
Working on the image library, I'm wanting to have all my resources / pictures available via a web site ... but I really don't want to hold them at full resolution - for our needs, 800 x 600 is quite big enough and the storage and bandwidth when I call up lots of pictures would be something of an issue. Using ...
2390Dynamic / changing images on your web page
There are a number of different ways to provide dynamic (changing) images within a web page ... but as they're mostly client side technology based, they're not something I commonly get involved in. However, just yesterday I was thinking of using exactly such a dynamic image in my post telling you about ...
2361Geocoding - converting address to latitude / Longitude with PHP via Google
We have a 'geocoding' example here, and indeed I was using it earlier today. The idea is that someone enters part of an address on your web site, and you contact Google to look up the latitude and longitude so that you can put it on a map, or calculate a distance from somewhere else. It's very need, ...
2343World Flags in your PHP pages
The world's flags are often used to give a quick visible international indication of countries (sidestepping the issue I had yesterday, where I was translating into ten languages and wanted links to each other language on each page and - well - what IS the Finnish for Italy?) So I have found an Icon ...
1104Drawing dynamic graphs in PHP
The web is all about presenting data, and a picture paints a thousand words - so what's better than a graph to quickly and easily present figures and trend to yor web site visitor? There's a great deal of software available to produce static diagrams and graphs as image files - .gif or .jpg are the ...
1956Images for Christmas
For just the winter holiday season, we'll be changing the image in our page header at seven minutes after five each morning. Will we be up at that time, then? Well - we might be but to make it consistent, we're using a crontab job on the server. This is the regular image ... And this is the image ...
1923Making it all worthwhile
I know that a lot of people use our resources ... and that very few of them get in touch. That's only natural - it's very rare for me to send a "thank you" to an author. So I was really touched to find the following in my email this morning: To Graham Ellis,   Just e-mailing to say thanks for ...
1389Controlling and labelling Google maps via PHP
"Can you use PHP to control what you show on a Google Map?" An innocent question that lead me off on an interesting exploration when I should (!) have been doing other things - but a very worthwhile couple of hours, and great fun! How do you do it? 1. Apply for your Google Maps key (you'll need to ...
1756Ever had One of THOSE mornings?
Do you ever have one of those mornings where every (simple) task seems to take an age - where every code change that would normally be automatic for you results in a string of mis-spellings and syntax errors? I set out when I rose at dawn this morning to change the front page on our ...
1391Ordnance Survey Grid Reference to Latitude / Longitude
I've already written about conversion of postal addresses to latitude and longitude using Google's interface - but what is I want to convert the Ordinance Survey's grid references into latitude and longitude? Google's interface doesn't support the OS units - and in any case it's "just" a a calculation. ...
1752Dynamic maps / geographics in PHP
I've been doing some work with log file / exception report analysis over the past few days, with a geographic slant. And I've come to the conclusion that a picture paints a thousand words ... or even more! Do you prefer a listing of log file data - in this first case of trains that are shorter than ...
1734All around the world?
Can you guess what the following have in common? Oregon, United StatesBeijing, ChinaMadhya Pradesh, IndiaWestern, Sri LankaKorea, Republic ofZuid-Holland, Netherlands Gauteng, South AfricaBrazilRegion Metropolitana, ChileVictoria, AustraliaMakkah, Saudi ArabiaDubai, United Arab EmiratesT'ai-pei, TaiwanIndiaPerak, ...
1724addslashes v mysql_real_escape_string in PHP
One of the most popular pages on our website is the one that shows you how to upload an image and store it in a database. And the associated demonstration showing you how to view images via a PHP script from a MySQL database is very popular too. An image may contain and ASCII characters at all ... ...
320Ordnance Survey - using a 'Get a map'
Sunday, and a chance to play. I've been interested in the possibilities offered by Ordnance Survey's "Get a map" service - which allows (with limitations described on their site) their mapping to be captured and used on web sites in a not-for-profit way. I've started to put up a whole load of pictures ...
937Display an image from a MySQL database in a web page via PHP
There's lots of clever scripts around to tell you how to get images in and out of databases, but nothing simple to show you the principles of including such an image via (say) PHP in a web page. So here goes. you need TWO URLs - you need the HTML page that's going to contain the image, AND you need ...
1628Gant charts - drawing them with a PHP script
I wrote a piece of project planning code - to generate GANT charts in PHP - when we were planning all the works on Well House Manor the best part of 2 years ago now. And although I did little more that provide a screen capture here on "The Horse's Mouth", one of our popular hits has turned out to be ...
1194Drawing hands on a clock face - PHP
Would you like to draw clock face hands on to an image (such as the one shown here, with the time in UK when you called the page up!)? It's easier than you think using PHP's GD module. Instead of supplying a fixed image in your <img> tag, provide the URL of a PHP script that reads an image and ...
563Merging pictures using PHP and GD
I wanted, regrettably, to fade (tear) one picture into another - a train at Melksham into a picture of a disused railway trackbed. We have one of those nearby at Seend, where the Trowbridge - Devizes - Reading - London train service used to run. Here's another 2 options I looked at: and The ...
665PHP Image viewing application
PHP has some marvellous facilities for image handling, and I've incorporated some of them into a new thumbnail-viewing demonstration that takes you around many of the images used on our Wiki pages. The source code of the thumbnail viewer is also available, and you're very welcome to make use of it ... ...
Examples from our training material
fpdf_demo.php   Sample using fpdf (free PDF convertor from
index.php   All the images in a folder as thumbnails
isp.php   Plotting your web site visitors on a world map
isp_eu.php   Plot web site visitors on a map of Europe
latlong2os.php   latitude / longitude to ordnance Survey grid positions
pictureindex.php   Thumbnail library, Mk 2 - main program
popup.php   A popup window to show details of an item on a page
qr_demo.php   Dynamic qr code
railinfo.php   Convert Latitude and Longitude to nearest stations
railstats.txt   Railway Station codes, locations, usage 2004 - 2014
railtrends.php   OO based GD graphics example
railuse.php   Table and graph of same data
serverlog.php   Graphing server log files
shift_graphic.php   Shift Graphic Demo
showmanor.php   Slide Show - single file example
showmap.php   Selecting from an image map
tfd.txt   Bare data that we've cached from our application server
tfdt.txt   Sample text file - location of places on image
tgf.html   Graphic and report based on data from application server
th_2.php   Thumbnail library, Mk 2 - thumbnail generator
thumbnew.php   Image rotate and thumbnail
totem.php   BR Totem graphic generator
train_graphic.php   Display info from application server on an image
train_pixelreport.php   An easy way to add an image point to a file
yearson.php   Plot years v data
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Interfacing to Google maps.
Ordnance Survey data.
Sorting by location.
Drawing Graphs and diagrams in PHP.
Random Images.
Hotlinked images.
Complete learning
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.

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: • WEB: • SKYPE: wellho

PAGE: • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb