Welcome To Snipplr


Everyone's Recent Snippets



1 ... 375 376 377 378 379 ... 553
0 1337 posted 16 years ago by paulbooker
A simple function that generates a select drop down. It takes 3 values. The select name ,the mode (true for hours / false for minutes) and the selected option.
1 1691 posted 16 years ago by chchrist
1 1645 posted 16 years ago by paulgrenwood
Search Engine Optimisation, or SEO is something that a lot of bloggers get obsessed about, whilst others think it’s a load of rubbish. I’m halfway between the two – whilst I believe that you can change certain things to better SEO your content,...
0 1180 posted 16 years ago by paulgrenwood
Whilst there are a number of ways of displaying thumbnails, this is still my favourite (even if it does require the most work!). First, upload timthumb to /wp-content/themes/yourtheme/ and create an image 250px by 250px with your site’s logo and up...
0 1447 posted 16 years ago by paulgrenwood
This is something that I wished I’d thought of a long time ago – show other posts in the same series using not a plugin but custom fields. All you’ve got to do for this trick to work is create a custom field ‘Series’ with a link to each oth...
1 1267 posted 16 years ago by paulgrenwood
Allow Visitors to Email Posts to Their Friends
0 1160 posted 16 years ago by paulgrenwood
1 1238 posted 16 years ago by paulgrenwood
2 1420 posted 16 years ago by paulgrenwood
E-mail validation is perhaps the most used validation in web forms, this code will validate email address and also optionally check the MX records of the domain provided in email address to make email validation more robust.
2 1770 posted 16 years ago by paulgrenwood
This function will truncate strings only at word breaks which can be used to show a teaser for complete article without breaking words.
0 1511 posted 16 years ago by paulgrenwood
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 1622 posted 16 years ago by paulgrenwood
Some times you need to accept some url as input but users seldom add http:// to it, this code will add http:// to the URL if it’s not there.
1 1753 posted 16 years ago by paulgrenwood
With most of the popular web services like Twitter providing their data through APIs, it is always helpful to know how to parse API data which is sent in various formats including JSON, XML etc.
1 1249 posted 16 years ago by paulgrenwood
0 1351 posted 16 years ago by paulgrenwood
This snippet uses isset() instead strlen() to verify a PHP variable (in this example $username) is set and is at least six characters long.
0 1193 posted 16 years ago by paulgrenwood
This code will create a human readable string that will look more close to dictionary words, useful for captchas.
0 4576 posted 16 years ago by paulgrenwood
This function will fetch the real IP address of the user even if he is behind a proxy server.
0 1420 posted 16 years ago by paulgrenwood
If you don’t need human readable string, then use this function instead, which will create a random string you can use for user id’s etc.
1 1445 posted 16 years ago by paulgrenwood
Provide files to the user by forcing them to download.
0 1931 posted 16 years ago by paulgrenwood
With this snippet, you can encode any email address into HTML entities so that spam bots do not find it.
0 1350 posted 16 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0 1481 posted 16 years ago by paulgrenwood
1 1134 posted 16 years ago by paulgrenwood
IE adds a vertical scrollbar to textarea input fields regardless of the height of content in it. You can fix that with this simple CSS trick.
2 1810 posted 16 years ago by paulgrenwood
Some browsers like Firefox and IE add a dotted outline border over the link user clicked. It is a useful accessibility feature that lets user know which link he clicked or is in focus. But sometimes you need to get rid of this, here’s the CSS you n...
0 1295 posted 16 years ago by paulgrenwood
While most of the internet users prefer to read content online but some of your users might like to print your article. With CSS you can control the page breaks within content just add this CSS class to your stylesheet and add this class to any tag w...
1 1355 posted 16 years ago by paulgrenwood
This is a very tall order, and we are going to be pulling out all kinds of different stuff to make it happen. First of all, because the image needs to scale, a traditional CSS background-image is already disqualified. That leaves us with an inline im...
3 1635 posted 16 years ago by paulgrenwood
This CSS trick lets you highlight the input field currently in focus. This trick does not work in IE though.
0 1208 posted 16 years ago by paulgrenwood
1 ... 375 376 377 378 379 ... 553