Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 109 110 111 112 113 ... 147
Using the kohana framework for XSS protection
0 1331 posted 16 years ago by iloveitaly
sendmail needs to be working and configured properly uses popen and fputs
0 1937 posted 16 years ago by acosonic
0 1593 posted 16 years ago by okidoka
This is a quick & dirty helper for pumping out those annoying little link sharing URLS. I've kept it simple, so all it does is return a URL formatted for a particular service. To use it, just pass a string of the service name to the helper followe...
1 1334 posted 16 years ago by brettbergeron
Dumps whole query so developer can see where is error. However it's potential security issue, exposing SQL commands to attacker. (Recommended to use only during development, replace message code with some custom error text)
0 1517 posted 16 years ago by acosonic
Usually use in a template with `in_category()`, like `if ( in_category( 3 ) || in_subcategory( 3 ) ) { ...`. Tested in WP 2.8.4.
1 1450 posted 16 years ago by cyberhobo
Below are two functions I've been using to make event tracking a little easier in CodeIgniter. Two functions are available, google_analytics() & track_event(). google_analytics() takes one argument and uses it as the UA code for your tracking p...
5 1914 posted 16 years ago by brettbergeron
The below code helps you move your site assets (images, css, javascript) to a public folder inside the application directory of CodeIgniter. One thing you'll need to do is define ASSETPATH to be the path to the location of your public items. For m...
1 1257 posted 16 years ago by brettbergeron
A simple class layout template that I always use to get me started. Nothing fancy. Just your basic structure.
1 1449 posted 16 years ago by StrawMan
This piece of code will store each line of a txt file into a mysql database
2 2026 posted 16 years ago by fackz
remove multiple spaces and replace with underscore
0 1162 posted 16 years ago by rombob
This function converts file size in bytes to the larger units. You can add bigger values like exa-, zetta-, yotta- bytes.
0 1212 posted 16 years ago by kirik
I made this script to count the days until a birthday, the birthdays are stored in mysql with the year intact YYYY-MM-DD, so this function strips the first 4 chars, and adds the current year, if the date has already passed it adds the next year and c...
9 2733 posted 16 years ago by jcroom
0 1075 posted 16 years ago by jonniespratley
0 1066 posted 16 years ago by jonniespratley
http://code.google.com/p/jquery-jtwitter/ for examples.
2 1563 posted 16 years ago by jonniespratley
1 977 posted 16 years ago by radarseven
I recently found the need to run multiple CodeIgniter applications inside of a single codebase for development & test purposes. So, I rewrote a few lines of the primary index file (/index.php) to automatically route URLs like subdomain.domain.com to...
3 1532 posted 16 years ago by brettbergeron
--
0 1233 posted 16 years ago by nico65
Take the contens from a table in MySQL and display it in an email
2 1144 posted 16 years ago by jcroom
2 1232 posted 16 years ago by willemmulder
sku on magento frontend
0 1101 posted 16 years ago by nico65
This code will create a human readable string that will look more close to dictionary words, useful for captchas.
3 2394 posted 16 years ago by Mithun
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
2 1513 posted 16 years ago by Mithun
0 1357 posted 16 years ago by iTony
/app/code/core/Mage/Newsletter/Model/Subscriber.php $this->sendConfirmationSuccessEmail();
0 1055 posted 16 years ago by nico65
0 1161 posted 16 years ago by dsntos
0 3058 posted 16 years ago by traeregan
Get the ID of the root (oldest ancestor, parent without parents) page relative to the current page in a WordPress page template. Can be helpful for use with wp\_list\_pages() to create navigation markup.
1 1634 posted 16 years ago by cyberhobo
1 ... 109 110 111 112 113 ... 147