Archive

Archive for the ‘PHP/MySQL Programming’ Category

Object Oriented Programming using PHP: Cheat Sheet

March 9th, 2010

To make our lives that little bit easier we’ve put together a simple cheat sheet containing the basics of object oriented programming (OOP for short) to help us along the way. This is not a guide on how to use OOP nor will it explain the concepts - it’s merely a reference to use when [...]

PHP/MySQL Programming

Validating an email address in PHP

May 13th, 2008

A small tutorial and example script to validate the format of an e-mail address. This is very useful when capturing e-mail addresses from visitors.
If you’re using the e-mail address to send out important information then it’s advisable to ask the user to enter it twice, to account for misspelling.
<?php

#email address to validate
$email = “name@domain.com”;

#validate format
if(!eregi(”^[_&a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+
(.[a-z0-9-]+)*(.[a-z]{2,4})$”, [...]

PHP/MySQL Programming , ,

UK Post Code Distance Calculator using PHP/MySQL

March 30th, 2008

Ever wondered how websites can tell you how far it is from one UK post code to another? This tutorial will tell you everything you need to know about adding this cool feature to your website using PHP and MySQL. Warning - although there is complex maths involved, no clever maths knowledge is required.
How it [...]

PHP/MySQL Programming

Handy tip to see the PHP credits

November 7th, 2007

Ever wanted to see who was responsible for giving us the server-side scripting language, PHP? Thought so. So here’s a handy tip for displaying the names of the folks who were responsible, right from any PHP script.
To view the PHP credits simply add the following URL variable to the end of the URL of a [...]

PHP/MySQL Programming

List of UK counties in SQL & CSV format

September 19th, 2007

During a recent project, we had to compile a definitive list of counties within the UK (excluding Northern Ireland). This proved harder than we’d anticipated so we thought we’d publish the list in both CSV and SQL formats. Aren’t we lovely?
CSV for List of UK Counties
Download CSV: uk-counties.csv (2KB)
SQL for List of UK Counties
Download SQL: uk-counties.sql (13KB)
The SQL creates [...]

PHP/MySQL Programming

Sending e-mail from PHP using mail()

April 11th, 2007

A very simple tutorial to send an e-mail directly from a PHP script using the built-in mail() function. Great for processing forms or just to debug an application.
For sending more advanced e-mail, including HTML, we recommend the PHPMailer class, however, for sending a basic e-mail the easy way, we use this simple function provided by PHP.
The [...]

PHP/MySQL Programming

Our fight against spammers continue…

March 26th, 2007

Form spammers are one of the most annoying things facing website owners and developers. These are the guys which create automated bots to fill in your forms with spam, in the hope that it will be posted on your website. Thankfully, there are ways around this!
Our blog is constantly under attack from these spammers and [...]

PHP/MySQL Programming

How to create a secure user login with PHP and MySQL

February 26th, 2007

Almost all modern web applications contain a login of some description. Whether you give your visitors benefits from being a registered user or run an online store, a login form is essential. This article describes one of the many ways to implement this facility using PHP and MySQL. The login process checks for an invalid [...]

PHP/MySQL Programming

How to send e-mail newsletters using PHP and PHPMailer

October 1st, 2006

Without going into the intricacies of HTML or plain text e-mails this tutorial gets stuck into the ‘nitty gritty’ code required to successfully send e-mail newsletters. While there are ready made solutions on the market to manage mailing lists and send out bulk e-mail, there’s nothing like building your own - with the ability to [...]

PHP/MySQL Programming

The doom of 2038

September 17th, 2006

Pack the food tins, batteries, clothing, and maybe build a little bunker as the millennium bug is back! (Except we’ve got until 2038 and it will be far easier to fix).
Back in 2000 the world was in turmoil as the Y2K bug reared its ugly head. The world’s computer systems were set to explode, money [...]

PHP/MySQL Programming