Background Colour Gradients in CSS

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...

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

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...

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...

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_...

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...

Add and Remove Options in Select using jQuery

Removing an item from a select box using jQuery JQuery is a easy way of using JavaScript reducing the time it takes to code and reduces the amount of lines you need to code. This is a good example of...

Javascript isNumeric Function

When working with user inputs in web pages it is important that you validate all the inputs, this is so you can check that what the user is entering is the type of data you are expecting. It is import...

Check to see if a element exists in jQuery

In raw javascript using when dynamic elements you need to check to see if the element exists before you perform a certain action to the element or you will get a element undefined error. This is no di...

PHP Delete Directory and Files In Directory

In PHP if you want to delete a directory there is security against deleting a directory which has files in it. Therefore you need to delete all the files in the folder before you can delete the direct...

Gradient Colour Generator

For many web designs images which consist of colour gradients are used for background images, footers and headers. But since the web is all about loading times and trying to speed up your site loading...