Web Design Blog

This is where we store some of our Web Development thoughts, tips and tricks, just because we like to share.

WordPress – Removing Unwanted Header Elements

By default, WordPress tends to load a lot of junk in the header. So, for example, if you “view source” when looking at a wordpress blog post, you’ll typically see the following load in the header: 1 2 3 4 5 6 <link rel="EditURI" type="application/rsd+xml" title="RSD" href="" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="wlwmanifest.xml" /> <link rel=’index’ [...]

26 Oct 2010 / 0 Comments / Wordpress / by Maruf

PHP – Creating A Year (date) Loop

Here’s a good/efficient way of building a loop of years from a starting point to an ending point. For example, this code will show you how to print a range of years from 2000 to 2010: 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 The code is particularly useful if you want to [...]

30 Sep 2010 / 4 Comments / PHP Scripts, Tips & Tricks / by Maruf

Ajax JQuery – Rotating Image Script

I can’t remember for the life of me where I got this code from, but if I could, I’d give the author the credit. I didn’t write this code, but it’s something I wanted to share because it’s pretty cool. There are HUNDREDS of image rotating scripts out there, but I like this one in [...]

27 Aug 2010 / 0 Comments / jQuery Scripts & Helpful Snippets / by Maruf

PHP – Capitalize First Letter Of Every Sentence For Proper Formatting

Here’s an extremely useful snippet of code that will properly format sentences with capitalization. Actually, what the code really does is capitialize every letter AFTER a full-stop (period). Here’s an example of what the code will do… Before: Hello This Is An Example Of A Sentence Which Has Odd Capitalization Which You May Want Fixing. [...]

31 Jul 2010 / 5 Comments / PHP Scripts, Tips & Tricks / by Maruf

PHP / MySQL – Strip Content And Only Display Images From A MySQL Table

This is another one of those quite specific pieces of code, so I doubt many people will need it. I think the code is quite useful, so I thought i’d make a post about it. Anyways, I’m going to show you how you can pull just images out of a field in a MySQL table. [...]

20 Jun 2010 / 4 Comments / MySQL & PHP / by Maruf

PHP – Populate Date Dropdowns – HTML Forms

Ok, i’m going to quickly jot down some PHP code, which dynamically populates date fields (dd/mm/yyyy) for HTML forms. I’m always using this code, but I never write it down, so i’m forever retyping it! To generate the date dropdown fields shown above, you could hardcode the values, like this…. 1 2 3 4 5 [...]

10 Jun 2010 / 1 Comment / PHP Scripts, Tips & Tricks / by Maruf

Javascript – How To Remove The Trailing Hash In A URL

Ok, this is a quick note to myself, because I always seem to forget this code, and I have no idea why, because it’s so simple. So, the scenario is that when I’m writing AJAX code, a lot of the times I use a hyperlink to trigger an action. For example, look at the following [...]

25 Apr 2010 / 2 Comments / Javascript / by Maruf

Ajax – Rotating Text

I just implemented a new feature on Property Investment for the Landlord, which shows a box rotating through various text blocks. Just for clarification, this code doesn’t just apply to rotating “text”, you can put images or anything you want in there. This is just a flat image example: I used the excellent Jquery Innerfade [...]

29 Mar 2010 / 1 Comment / jQuery Scripts & Helpful Snippets / by Maruf

OsCommerce – SagePay Form Error – 3144: The Delivery information is required

I’ve recently installed Sagepay Form on a clients shopping cart, which is powered by osCommerce Version 2.2. The installation was pretty simple. I had to install the osCommerce SagePay Form Module and then do various other things to get the account live. Once the account was live I stumbled upon quite a serious problem. The [...]

25 Mar 2010 / 2 Comments / osCommerce / by Maruf

Ajax JQuery / PHP – Refresh Table When Inserting Row Into a MySQL Database

I’ve had a few people asking me how to refresh a table (not the entire page) when inserting rows into a MySQL database, so I thought I’d quickly put together a small demo. Here’s a basic demo of what I’m talking about. If you populate the form and press “Submit” you’ll notice the table updates [...]

09 Mar 2010 / 15 Comments / jQuery Scripts & Helpful Snippets / by Maruf

PHP/MySQL- Escape All POST Or GET Variables For MySQL INSERT

I’m quickly going to demonstrate how to escape special characters in a string for all POST/GET variables safe for a MySQL INSERT query when passing values from a HTML form. So, let’s say we have a form like this on index.php: Details First Name: Surname: Email: 1 2 3 4 5 6 7 8 9 [...]

16 Feb 2010 / 2 Comments / MySQL & PHP / by Maruf

MySQL – INSERT SELECT Example

I’m quickly going to demonstrate how to INSERT rows from one table into another table. I’d just like to clarify, this isn’t the same as completely copying a table, because with a INSERT SELECT query you can use the WHERE clause to INSERT rows with a particular condition (e.g. WHERE name = ‘Bill’). Whereas, copying [...]

14 Feb 2010 / 0 Comments / MySQL Functions, Tips & Tricks / by Maruf

MySQL- Remove Duplicate Rows

I’ve been working with meduim sized tables (2.1million rows) in MySQL lately. One particular table had a lot of duplicate rows, which I needed to filter out. I’m quickly going to demonstrate how I did it. I’m sure there are many ways of doing this, but this method proved to be the easiest for me. [...]

22 Nov 2009 / 5 Comments / MySQL Functions, Tips & Tricks / by Maruf

Htaccess- 301 Redirect An Entire Directory / Folder

Here’s a simple pierce of code which will permanently redirect a folder / directory. For example, if you have a directory in the following path: http://www.example.com/pictures/, and for whatever reason decide to rename the directory to http://www.example.com/new-pictures/, the following htaccess code will safely redirect all users from /pictures/ to /new-pictures/ Redirect An Entire Directory / [...]

19 Sep 2009 / 5 Comments / htaccess fun / by Maruf

PHP- Using Preg_replace To Strip Date From URL

This is a very specific problem I was faced with a few days ago, so I doubt many people will find it directly useful. However, the solution to this problem can be used to resolve a load of tricky regular expression issues. The Scenerio A client recently changed permalink structures for his entire website. For [...]

18 Sep 2009 / 0 Comments / PHP Scripts, Tips & Tricks / by Maruf
Page 2 of 512345
© 2012 BrightCherry :)