Cheat Sheets
Regular Expressions (V1)
JavaScript
PHP (V1)
Articles
Writing Secure PHP, Part 4
The fourth part of the Writing Secure PHP series, covering cross-site scripting, cross-site request forgery and character encoding security issues.
Writing Secure PHP, Part 1
Learn how to avoid some of the most common mistakes in PHP, and so make your sites more secure.
Output Caching for Beginners
High-traffic sites can often benefit from caching of pages, to save processing of the same data over and over again. This caching tutorial runs through the basics of file caching in PHP.
Blog and Lab
CSS Drop-Shadows Without Images

CSS Drop-Shadows Without Images (posted from ZooTool).
18 February 2011 | 5 comments | css, css3, drop shadow, shadow, drop shadows, shadows, code, csstechniques, demo, effects
PHP Querystring Functions
Adding and removing variables to and from URLs using PHP can be a relatively simple process admittedly, but I have a couple of functions I use often to make the process even less time-consuming.
Add Querystring Variable
A PHP function that will add the querystring variable $key with a value $value to $url. If $key is already specified within $url, it will replace it.
function add_querystring_var($url, $key, $value) {
$url = preg_replace('/(.*)(?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');
$url = substr($url, 0, -1);
if (strpos($url, '?') === false) {
return ($url . '?' . $key . '=' . $value);
} else {
return ($url . '&' . $key . '=' . $value);
}
}
Remove Querystring Variable
A PHP function that will remove the variable $key and its value from the given $url.
function remove_querystring_var($url, $key) {
$url = preg_replace('/(.*)(?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');
$url = substr($url, 0, -1);
return ($url);
}
05 December 2006 | 49 comments | links, code, development, url, querystring, reference, php, functions, programming, tips, variable
RSS to iCal
I have been looking for a way to convert the BBC weather feed for my area to iCal, so I can subscribe to it. It's date-based, after all, and RSS never seemed to me to be an appropriate format for subscribing to weather information. iCal always struck me as being "better" for that purpose. Of course, the BBC only have an RSS feed for local weather. What I needed was a converter.
After some hunting, I discovered that Dean Sanvitale had written a PHP script to convert RSS feeds to iCal format. However, his site (codent.com) appears to be long since abandoned and the script is no longer available from there. Fortunately, the Wayback Machine did have a copy. Dean originally released the script under a Creative Commons License which, fortunately, allows me to make the script available to download from this site (note: the script is available from this site under the same license).
So, if you're looking for a way to convert an RSS feed to iCal, this PHP script will do the job. Thanks Dean!
Source: rss2ical.txt
19 October 2006 | 15 comments | rss, weather, php, bbc, ical, convert, tools, web, webdev, code, rss2ical
Preload Images with CSS
How to preload images using CSS and so avoid delays with rollover effects.
Click here to read this post »
23 December 2004 | 57 comments | code, rollover, webdev, howto, preload, web, design, image, webdesign, images, css
View Page Structure
A tool that outputs the structure of a page. Makes working with CSS (especially resolving inheritance issues) much easier.
Click here to read this post »
12 October 2004 | 26 comments | imported, code, xhtml, tool, cheatsheet, design, webdesign, useful, tools, resources, css
Gunning-Fog Index
The Gunning-Fog Index is a measure of text readability based upon sentence length and difficult words in a passage.
Click here to read this post »
06 July 2004 | 7 comments | code, programming, php, tools, readability, language
Email Address Validation
How to validate email addresses according to ISO standards with PHP.
Click here to read this post »
01 June 2004 | 200 comments | code, development, email, php, programming, regex, regexp, security, tutorial, validation, webdesign
VBScript Regular Expressions
Regular expression reference and examples for VBScript.
Click here to read this post »
07 November 2003 | 31 comments | code, regex, regexp, reference, programming, asp, vbscript, vb, regular, scripting, expressions, regular-expressions
