All Posts in How-to

Fancybox rel attribute doesn’t validate

If you're using fancybox and tried to validate your code you'll get this error if you use the rel attribute: Bad value fancybox for attribute rel on element a: The string fancybox is not a registered …

How to centre absolutely positioned elements on screen

If you want to place absolutely positioned elements in the middle of the screen just do the following: #some_div{ width: 150px; height: 100px; position: absolute; top: 50%; …

How to add even and odd classes to posts

First declare this variable before your while or foreach loop: <?php $j = ''; ?> Then paste this code within the class attribute of your element within the loop: <?php echo (++$j % 2…

How-to do a 301 Redirect for dynamic URL’s with .htaccess

Let's say these are the url's you're working with: http://www.example.com/page.php?id=1http://www.example.com/page.php?id=27http://www.ex…

How to Find & Replace in MySQL

First, do a search in your phpMyAdmin to figure out which tables contain the string you're looking for (i.e. %string to find%). update [table_name] set [field_name] = replace([field_name],'[string_…