Category Archives: Programming

Google’s PacMan Game is Still Online

For those who loved it, you can play Google’s tribute to PacMan at http://www.google.com/pacman.

While we’re talking about it, I’d like to point out that the PacMan game relies on HTML, CSS and JavaScript. No Adobe Flash used here. A great example of just what can be done with open technologies. I hope it encourages other developers to make use of these tools.

How to prevent multiple form submissions in PHP

A problem that many programmers encounter is trying to prevent the user from submitting a form twice and inadvertently posting two sets of the same data – or in worse scenarios, charging a credit card twice!

It’s a frustrating problem that is easily solved if you put your mind to it – ignoring it is nothing short of lazy.

On the client-side, we can use JavaScript to prevent the user from submitting the form more than once. Observe:

Continue reading How to prevent multiple form submissions in PHP

How to use SSL / HTTPS effectively in your PHP website

So, you’ve got a big website with thousands of members, it brings in $50 a day, and your community couldn’t be happier. What could be better? HTTPS could be better.

There’s just something so exciting about that little padlock appearing beside your domain name. To your customers it shows that you care about their online safety, and that you want them to feel safe.

But, HTTPS can be a complete pain to code, and many people go about it completely the wrong way. So here’s my entry to help those of you struggling with integrating HTTPS in PHP.

Continue reading How to use SSL / HTTPS effectively in your PHP website

How to avoid the SPAM filters with PHP mail()

Its a coder’s worst nightmare – sending emails from scripts! I can’t think of anything I dread more when designing a website, somehow whatever I learned the last time I did it has changed drastically whenever I decide to do it again.

It isn’t just me either, coders across the globe hit the same brick wall and continuously bang their heads against it. You can re-arrange the headers as many times as you like, it isn’t going to work.

But a few months back I discovered something that really does make a big difference to SPAM filters, and should probably be the first thing you check as it can make or break your script.

Continue reading How to avoid the SPAM filters with PHP mail()

Flaws in PHP sessions – session_start causes site to run slowly

PHP is a versatile language that gives the programmer many tools to get the job done. One such tool is sessions, but in some cases sessions can have a detrimental effect on your site’s performance.

Since switching from a Windows server to a UNIX server, I noticed a huge increase in overall site performance – but sometimes, with no noticeable pattern, a page would take a minute to load against the average which was under a second.

After messing with the scripts and painstakingly commenting out sections of code, I discovered that the problem lie quietly in the PHP sessions Рspecifically the session_start function. Perhaps it has something to do with disk operations and UNIX operating systems, whatever it was it was causing some frustrating performance problems.

Continue reading Flaws in PHP sessions – session_start causes site to run slowly

Review: PHP Expert Editor – Script Editing Tool

For anybody coding or wanting to code in PHP, a decent editor is vital. Sticking with old-fashioned notepad just won’t cut it, what you need is the mothership of editors – and I think I’ve found it!

PHP Expert Editor is developed by Ankord Development Group, and is one of the more serious entries in this field. And at 35 EUR for a life time license, it won’t shred your wallet either. (What? You didn’t expect it to be free, did you?)

Continue reading Review: PHP Expert Editor – Script Editing Tool

(Part 1) PHP & MySQL: How to create a resource system

One of the biggest problems faced with content rich websites is how to store the data than enriches them. Therefore, I’d like to offer my solution – something I call ‘the resource system’.

Specifically, this is designed for PHP & MySQL, but in theory could be adapted to work with other platforms.

The idea is to take the large part of the data (the content) and place it into a set of tables where it can be managed by a resource system.

Continue reading (Part 1) PHP & MySQL: How to create a resource system