6th
AUG

A simple way to ease spam from forms

2 Comments

Posted by under Programming, jQuery

A common request we get from many of our clients is “How do I stop spam coming through from forms on my website?”. Some client’s sites we have seen can get upto 80-100 spam emails in one day from forms on their website - this of course is very frustrating for them especially when you need to look a bit closer at these emails in case they are a genuine email.

One of the common approaches these days is to use a image verification system (usually called Captcha) but this can become very  annoying for an end user especially when it is difficult to read. Plus, these forms are usually enquiry/contact forms which are very critical to help generate sales for the client so making them unattractive and difficult to a end user can reduce the number of enquiries sent. Read the rest of this entry »

29th
JUL

Firefox 3 mulitple ajax requests not updating

2 Comments

Posted by Lee under CodeIgniter, Programming

This morning I managed to get caught up trying to work out a problem I was facing with some content that was being updated via ajax (using jQuery). Whenever I went to perform the same action/url twice it wouldn’t update - in my case a toggle switch for displaying an item. It seemed to be a caching problem but (suprisingly) IE7 worked fine so it started to point towards something wrong with Firefox 3. Read the rest of this entry »

8th
JUL

Validate multiple forms with same class with jQuery Validator

0 Comments

Posted by Lee under Programming, jQuery

Ran into a very frustrating problem today whilst developing a dynamic form generator for Breeze CMS - we needed the jQuery Validator plugin (worth the download!) to be able to validate multiple forms (that had the same content) but the fun part was that we don’t know how many forms there would be. I thought it would be as simple as setting a common class for the forms and attaching the validate function to them but it wasn’t. Read the rest of this entry »

26th
JUN

Gzip and cache CSS and Javascript files dynamically for faster page loads

0 Comments

Posted by Lee under CodeIgniter, Programming

David came across a handy script the other day that we have decided to implement into our CMS that dynamically Gzips and caches CSS and JS files - all without the need to have to change any of your HTML source destinations for those files. As a part of the implementation I also setup the script to work within the standard CodeIgniter cache setup and file structure. Read the rest of this entry »

24th
JUN

List duplicate database queries in CodeIgniter

0 Comments

Posted by Lee under CodeIgniter, CodeIgniter Libraries, Programming

Sure we all like to think that we’re masters of our code but there does come times that you may not realise a database query (usually from a model) has been duplicated a few times. Sure it’s no big problem but when it comes to optimising your website this is one of the first things I would start hunting down to increase performance of a site - you’ve already got the dataset once so why do you need it again if it hasn’t been changed? Read the rest of this entry »

17th
JUN

Darken or lighten colours dynamically using PHP

0 Comments

Posted by Lee under Programming

For a recent client’s site we needed to have a function that would be able to darken a given hex colour (eg. #f4129c) on the fly (it was changing the border colour to be darker then the background colour). It took a while to find anything that could remotely do this as many samples seemed to have flaws with certain colours. We also decided to make our own function able to make a colour lighter as well as darker. Read the rest of this entry »

13th
JUN

Get HREF attribute keeps on returning absolute link not relative link

0 Comments

Posted by Lee under Programming, jQuery

Whilst working on our new Image Manager in Breeze we came across an interesting bug that was causing images to be incorrectly linked to in the editor due to Internet Explorer (IE6 & IE7 intermittently) returning the wrong HREF value for a link. Read the rest of this entry »

18th
MAY

Stopping mySQL “too many connections” errors in PHP

0 Comments

Posted by Lee under General

At 5:03pm last Friday afternoon whilst demoing a new site to a client I came to see the ever so lovely “too many connections” error from mySQL (or in the case of CodeIgniter - could not connect to database error). I knew what was going to hit me next, the calls from clients who are having problems as well accessing their websites - and sure enough about 5 minutes later they started to come through so I just did a quick restart of mySQL and Apache which cleared the problem, but I wanted to work out how to stop this from happening again.

Read the rest of this entry »

The Lab is the web development blog for PX Webdesign that covers many subjects fromrss PHP, CSS, jQuery, CodeIgniter, Design and XHTML / HTML

Recent Posts

Categories

Archives

Links