Background Colour Gradients in CSS

## What? CSS allows you to create a background colour gradient on any element. Allowing the background colour to change colour from beginning of the element to the end. This increases readability on...

CSS Button Generator

## Introduction There are certain things which you do many times in web design and one of them is creating buttons for your pages. Before CSS3 to create a unique button you would have to use some grap...

Transparency using CSS3

What? Using a new feature with CSS you can set a transparency to any element on the your website. This can be a div or a paragraph, which can be useful to use when you have a text with a background co...

Hide Header1 Text if using Logo Image

What? A website logo is normally an image made up to brand the company. But this is not the best way in terms of SEO as it will expect text. Use CSS to place the logo as an image background on the h1...

Text Shadow in CSS3

What? Apply a shadow to any text in any direction using any color in pure CSS. ## Why? Before CSS3 the only way to add a shadow to text on a web page is to create an image using software such as Photo...

Decimal places in width using pixels

The other day I was designing a nice little tool which will drag and drop divs using the JQuery UI framework, the issue I was having was the difference in browsers on certain measurements. As it was d...

Force download of files in PHP

If you have files on your website that you want people to download you need to change the code to allow the browser to automatically download the file. This is because if you had an image on your webs...

Compress multiple CSS Files

If you are using multiple CSS files on a large website sometimes they can take along time to long the best way to deal with this is to compress the CSS by removing all comments and spaces in the file....

Convert Seconds to Time in PHP

Here is useful function to convert seconds to a time either years, months, days or hours. function Sec2Time($time){ if(is_numeric($time)){ $value = array( "years" => 0, "days" =&am...

Calculate distances in PHP

Here is a code snippet which allows you to calculate the distance between longitude and latitudes in either miles, kilometres or nautical miles. function distance($lat1, $lon1, $lat2, $lon2, $unit) {...

Easily cache pages with PHP

If you are not using a CMS or a framework you may need to cache your pages to speed up the page loading times. This can easily be done in PHP using the ob functions. OB Function In PHP ob_start() ob_...

Speed up Page Load by reducing HTTP requests with PHP

A nice technique to speed up your page loading times is to try to reduce the amount of calls your browsers has to make to the server. This will be every image, every css and every JavaScript file incl...

How to check if checkbox is checked using jQuery

I needed to find if a checkbox was checked in jquery but I knew of multiple ways to do this. But I wasn’t sure of the best way to perform this task. Still I haven’t decided on the best way to do this...

Using cURL in PHP

PHP/CURL is a binding that uses libcurl. It means that the PHP team has written a glue layer for PHP that speaks to the underlying libcurl. That layer, the binding, is what we call PHP/CURL and that i...

Remove Whitespace and line breaks in String

In any programming language there is a simple in-built function you can use to remove whitespace from a string the main one used will be a string replace to search for spaces and replace with empty. I...