I have PHP configured so that magic quotes are on and register globals are off.
I do my best to always call htmlentities() for anything I am outputing that is derive
Escaping all user input is enough for most sites. Also make sure that session IDs don't end up in the URL so they can't be stolen from the Referer
link to another site. Additionally, if you allow your users to submit links, make sure no javascript:
protocol links are allowed; these would execute a script as soon as the user clicks on the link.