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:

Read the rest of this entry

,

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.

Read the rest of this entry

,

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.

Read the rest of this entry

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.

Read the rest of this entry

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?)

Read the rest of this entry

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.

Read the rest of this entry

,

In designing my content enriched website, I quickly discovered that trying to handle large quantities of data is a real bottle neck that can be a pain to overcome.

So here’s a few (unorganised) tips that I think will help:

Read the rest of this entry