Snippets
Here's some of my tips, tweaks and tuts, ranging from PHP, Linux, MySQL and more!
Replace URLs with links - PHP
Technologies: PHP, HTMLDifficulty: EasyTime: 5 minutes Where I work, we develop many websites that have blogs and news sections. Often we allow users to add their own HTML snippets into the content of the articles in order to enhance the look and feel of the story. The Problem We often find that different users have different lev...
6th Jul, 2011 | » Read more Snippets like this | » Read More
Loop through the Alphabet with PHP
Difficulty: EasySnippet Length: 1 minuteTechnologies: PHP, HTMLI have several times wanted to provide a client with a facility to filter data by an alphabetic character and have done so by manually typing each letter of the alphabet with a hard link for example.Old Way A | B | C | D | E | F | G | H | etc... ...
15th Mar, 2011 | » Read more Snippets like this | » Read More
Find PLESK email passwords
Knowledge Needed: Plesk Parrallels, MySQL, LinuxSnippet Length: 5 minutesDifficulty: Easy It appears there is no incredibly obvious way inside PLESK to show email passwords. One way we can check is via MySQL The database needed is "psa". Usually you won't have access to this database via PhpMyAdmin so you may need to login via ssh ...
6th Mar, 2011 | » Read more Snippets like this | » Read More
Personalised PHP debugging
Snippet Length: 10 minutesKnowledge Required: PHP, HTMLDifficulty: Basic-Intermediate There are many situations where you find yourself fixing errors in php pages, a great way to fix it quickly would be to debug your code logically and methodically. One way to do this is to build your own debugging and error display function An E...
28th Feb, 2011 | » Read more Snippets like this | » Read More
Remove iPhone form input border
Difficulty: EasySnippet Length: 1 minuteKnowledge Needed: HTML, CSSBy default the iPhone browser adds an outline to any input boxes that have had their border or background colours removed through css.If you wish to just strip this you can use the following webkit declaration input { -webkit-appearance: none; } ...
16th Feb, 2011 | » Read more Snippets like this | » Read More
Hide php extension with Apache
Snippet Length: 10 minutes Difficulty: Easy Knowledge: PHP, Linux Administration, Vim Editor Ever wanted to get some pretty URLs without ever showing the file extension of the php 1. First step is to create a .htaccess in the root of your website if theres not one already there we can create it via the following line sud...
11th Feb, 2011 | » Read more Snippets like this | » Read More
Encode emails to stop spam harvesting
Snippet Length: 5 minutes Difficulty: Easy Knowledge: HTML Just a quick snippet here; there are many ways in which to make it as hard as possible for spam harvesting bots to scan for possible email addresses and store them one method is to HTML Encode each character in the mailto link. Let us take the following email address inf...
9th Feb, 2011 | » Read more Snippets like this | » Read More
Enable Wordpress featured image
Snippet Length: 5 minutes Difficulty: Easy Knowledge: PHP, Wordpress Custom Theme Development I thought I would share this as it was bugging me how some custom themes supported this for pages and posts. There didn't seem to be a be a standard way of doing this that didn't involve adding custom fields. It was around the time of v...
18th Jan, 2011 | » Read more Snippets like this | » Read More
SEO friendly URLs with apache
Snippet Length: 15 minutesDifficulty: Easy-IntermediateTechnologies: PHP, Linux System Administration, Apache Here is my take on the popular apache mod re direct; So your wanting your links to look readable by humans and search engines such as ; www.yoursite.com/news/19/latest-update-notes.html instead of www.yoursite.com/n...
4th Oct, 2010 | » Read more Snippets like this | » Read More
jQuery animation queue problem
Snippet Length: 2 minutesDifficulty: EasyTechnologies: JavaScript, jQuery, HTMLWhen I first starting playing around with jQuery I found myself encountering animated elements that were still moving/bouncing around long after they should have been. After investigating this I found that one way to counter act this would be use the jQuery fun...
2nd Oct, 2010 | » Read more Snippets like this | » Read More