News & Blog

My First E-Commerce Site – 5 Helpful Hints

November 24th, 2010 - Posted by Steve Marks to Web Development.
As Baz Lurhmann once famously sang, “Do one thing everyday that scares you”. Ok, well maybe this wasn’t exactly a day’s task and it certainly wasn’t a fear that was ruining my day-to-day life, but building an e-commerce site had never been at the top of my to-...

Only Applying a CSS Opacity to the Parent Container

November 16th, 2010 - Posted by Steve Marks to (X)HTML / CSS, Web Development.
If you’re reading this post you’ve probably realised by now that any elements included within a container that has had a CSS opacity applied will inherit this opacity also. Let’s look at a quick example of this scenario The CSS: body { background-color:#C00; } .container ...

Resolving the CodeIgniter “No Input File Specified” Error

November 16th, 2010 - Posted by Steve Marks to PHP, Web Development.
A site that I work with that is built on the CodeIgniter framework today started showing the error “No Input File Specified” when visiting any page other than the homepage. The cause wasn’t immediately available as I’d never seen this error before. It also wasn̵...

PHP Multipart Email Getting Cut Off

November 12th, 2010 - Posted by Steve Marks to PHP, Web Development.
By sending multipart emails we can send two versions of the same email at the same time; One sexy HTML version containing all the bells and whistles for modern email clients, and a fallback plain text version for older email clients or users who have HTML formatting disabled. Without the u...

Getting the First Word of a String with MySQL

November 10th, 2010 - Posted by Steve Marks to MySQL, Web Development.
I was recently assigned the task of getting the first word from a field in a MySQL table. In my case it was getting the first part of a customers postcode. Following a quick look through the MySQL reference manual I was guided towards the SUBSTRING_INDEX() function. By using this function ...

Forcing Long Strings and URLs to Wrap with CSS

November 10th, 2010 - Posted by Steve Marks to (X)HTML / CSS, Web Development.
Ever tried to squeeze a long word with no spaces or a URL into a small area? If so you may notice that different browsers deal with this differently. Let me give you a quick example: Our HTML: <div style="width:150px; border:2px solid #900;"> http://www.example.com/this/is/a/test/web...

How to Get the Last Character in a String with PHP

November 7th, 2010 - Posted by Steve Marks to Web Development.
There a number of ways to get the last character in a string by using PHP. The simplest way I find however is to use the substr() function like so: $str = "This is a string"; echo substr($str, -1); The above example would return ‘g’. By passing a negative value as the second pa...

Clearing Attachments Using CodeIgniter’s Email Class

November 4th, 2010 - Posted by Steve Marks to PHP, Web Development.
The CodeIgniter Email Class makes it very simple to send emails by handling the creation of mail headers and more on your behalf. My favourite benefit of the class however is it’s attachment handling. Whereas using standalone PHP it would take multiple lines of complex code to attach...

Inserting Multiple MySQL Records With One Query

November 3rd, 2010 - Posted by Steve Marks to MySQL, Web Development.
We can insert a single record into a MySQL table using the following format: INSERT INTO `table_name` (`column1`, `column2`, ...) VALUES ('value1', 'value2', ...) But how do we go about inserting more than one record at the same time? The answer is simple and involves us duplicating the la...

Detect InfoWindow Being Closed – Google Maps V3 API

November 2nd, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
If you’re including a map on your website using the Google Maps V3 API there’s a high chance you’ll be including overlaid markers and infowindows that are related to these markers. Adding the markers is simple enough, as is getting the infowindows to open upon clicking th...