function

function

Enabling Tabbing In A Textarea

Friday, June 20, 2008 - 09:42

When a user presses the tab key in a browser window the normal action is for the user to move the focus to a different control. To enable a word processor like tab effect in a text area you need to catch the keystroke and add in the tab character to where ever the cursor is. This is the main issue with creating this solution, it is easy to add a tab to the end of the text, but most users might want to add a tab half way through the text.

Take the following HTML text area.

Category: 

Print A Current Copywrite Notice With PHP

Tuesday, June 17, 2008 - 10:17

One thing that is inexcusable on any website is printing a copywrite notice that is out of date. There are many protagonists of this crime and it is fairly easy to spot.

However, rather than go through all of the pages on your site and hand code in the copywrite notice you could just put in the following little bit of PHP.

Category: 

Check Backlinks With PHP

Thursday, June 5, 2008 - 09:37

Backlinks are an important part of search engine optimisation and are also useful in seeing what sort of things are popular on your site. If you have a list of known backlinks that you want to keep track of then you can do it manually, or you can get a script to do it for you.

Category: 

Get Percentage Of A Number With PHP

Wednesday, June 4, 2008 - 09:47

Use the following function to find the percentage value of one number to another. If the $total parameter is zero then zero is returned as this would otherwise result in a division by zero error.

Category: 

Work Out The Number Of Days Before A Date

Saturday, May 31, 2008 - 21:20

Use the following function to work out the number of days between today and a date in the future. The function takes three parameters of the day, month and year of the date in question.

Category: 

Rot13 Function In PHP

Wednesday, May 14, 2008 - 09:47

Rot13 (which stands for "rotate by 13 places") is a name given to a simple encoding algorithm (or substitution cipher) that is used to mask text. It works by making each letter 13 spaces further along in the alphabet so that a becomes n and b becomes o. For the letter n the alphabet starts again from the beginning.

Category: