Exercises, examples and other material relating to training module H309. This topic is presented on public course
|Articles and tips on this subject||updated|
|3027||Server 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 ...
|4178||Where are you? How to write a geosensitive application|
|3817||Fpdf - 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 fpdf.org. 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, ...
|3734||QR 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 ...
|3584||QR 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 ...
|3536||UK 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 ...
|3447||Needle 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 ...
|3211||Computer 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 ...
|3197||Finding 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, ...
|1390||Converting 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 ...
|3133||An 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 ...
|2939||Protecting 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 "www.wellho.net", you should see a clean image - and the image is at the url "http://www.wellho.net/demo/doggypic.php". ...
|2729||Uploading 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 ...
|2675||Redirecting 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 http://www.wellho.net/demo/gmap.php which you can zoome to five levels at the click of a button and do other smart things with. And that ...
|2583||Reducing 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.
|2390||Dynamic / 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 ...
|2361||Geocoding - 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, ...
|2343||World 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 ...
|1104||Drawing 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 ...
|1956||Images 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 ...
|1923||Making 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 ...
|1389||Controlling 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 ...
|1756||Ever 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 http://www.wellho.co.uk ...
|1391||Ordnance 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. ...
|1752||Dynamic 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 ...
|1734||All 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, ...
|1724||addslashes 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 ... ...
|320||Ordnance 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 ...
|937||Display 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 ...
|1628||Gant 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 ...
|1194||Drawing 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 ...
|563||Merging 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:
|665||PHP 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 ... ...
Interfacing to Google maps.
Ordnance Survey data.
Sorting by location.
Drawing Graphs and diagrams in PHP.
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. Also
available is the Opentalk
Forum for discussion of technical questions.