Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
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
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 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, ...
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 ...
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 ...
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 "www.wellho.net", you should see a clean image - and the image is at the url "http://www.wellho.net/demo/doggypic.php". ...
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 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 ...
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 http://www.wellho.co.uk ...
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 www.fpdf.org)
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
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 - 2010 (+2011 added 29.3.2012) (+2012 added 4.4.2013)
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
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
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 http://www.training-notes.co.uk.
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 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. Also available is the Opentalk Forum for discussion of technical questions.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/H309.html • PAGE BUILT: Wed Mar 6 10:39:20 2013 • BUILD SYSTEM: wizard