David Preston

Musings of an old bloke.



Web Development

Posts 1 to 7 of 7

Apache Basic Authentication Username in Raw Access Logs

Here’s something that might be so blindingly obvious to everyone else in the world that I look like a jerk for talking about it, but I couldn't find the answer by searching Google, so I'm going to share it anyway. We are developing a web project at work that I can’t talk about yet, but the boss wanted to email a link and login details (the site is protected by… View More

A Developer’s CMS

I have used CMSs (Content Management Systems) for years, mainly Joomla, but also others. I don’t consider WordPress a CMS, but that’s just me. Anyhow, I came across a new (to me, anyway) one a few weeks ago that has very quickly become my favourite. It is called ProcessWire, and it is unusual because it has no front end. (The download comes with an example front end, but there is no requirement to use it.) So… View More

dpreston.com Now Powered by ProcessWire

After years of neglect, during which time server upgrades and Wordpress awkwardness almost rendered this blog completely inoperable, I finally made the leap to change its backend to ProcessWire. I first discovered ProcessWire a couple of years ago, and have built several sites with it since, mostly small ones but the odd biggie. The following… View More

Tidying & Formatting Postal Addresses in PHP

A couple of times in the course of my job, I've needed to tidy-up user input of postal addresses, usually when importing from an external database into a web application or taking input from a web form. It looks horrible when everything is in upper or lower case. PHP has strtoupper(), strtolower() and ucasewords() functions, but none of these does just what I needed. Googling found a few attempts to solve the same problem, and I've probably… View More

ProcessWire & CloudFlare

Erudite (or nosy) visitors may have noticed that I run this blog through a free CloudFlare account. This is a Good Thing, however it was breaking my ProcessWire admin (not a Good Thing), with the default CloudFlare optimisations. It turns out that the trick is to create a CloudFlare 'Page Rule' for dpreston.com/processwire/* (the asterisk wildcard character is important), such… View More

Filetype Associations in FileZilla Portable

This is one of those posts that is more of an aide-mémoire for me than anything else, although I will be pleased if it helps anyone else. The background was that I was going to write another blog post (not this one), but before then I wanted to change the width of the .container div and make it a bit wider. But I couldn't remember my own ftp login (embarrassing). So, Pro Tip 1, hi thee along to… View More

How to Insert a Space Character in HTML

A space, not a non-breaking space, just an ordinary space. Can't be that hard, can it? Well, you would think so. Or I'm rubbish at googling the right thing. I was working on a project at work, and adding schema.org markup which involved wrapping stuff in <span>s. Which in turn choked my HTML minifier and caused one particular space to disappear. Took me ages to find the solution; how… View More