Last updated 3 October 2011. Created on 29 November 2005.
Edited by JuliaKM, silverwing, LeeHunter, Jody Lynn. Log in to edit this page.

This section contains snippets of PHP that you can paste into your Drupal pages, blocks or themes. Often a single PHP block or a single PHP page does exactly what you want, where a module is pure overkill, or just doesn't get you exactly there.

Feel free to add new snippets or enhance existing ones. In fact, please try to reduce duplication as much as possible. It is better to improve an existing page than to add a new one.

For an introduction to snippets, see A beginner's guide to using snippets.

PLEASE NOTE! The following snippets are user-submitted and have not been independently tested. Use at your own risk! Please note that the snippets may contain some database queries specific to MySQL.

EVALUATE a snippet before copying and pasting it into your site. A user could potentially add a snippet that wipes your complete database!

JavaScript snippets should be placed in the JavaScript section.

Looking for support? Visit the forums, or join #drupal-support in IRC.