Tomhath - can you clarify this for me:
"you might want to assign the validated data to diffferent (untainted) variables and only use the $REQUEST variables in your validation routines."
Are you saying I cango ahead and get variables via $REQUEST (or $POST or $GET), then validate them (I assume: to ensure they're the right kind of data - i.e. alphanumeric, numeric, right number of digits, etc.), then I should convert the result to another variable before inserting into the db?
Actually this brings up a question about validation. Most of my data validates fairly neatly - I can run preg_match on it and verify it's a phone number, email, date, time, etc. But there are a number of fields in my system that accept straight text - the story content of a news article, for instance. Any suggestions for a place to look for a good preg_match sequence to allow everything that might be in such a story but not allow harmful characters?
And that makes me think of magic quotes. Magic quotes are supposed to escape control characters that might make MySQL do things I don't want it to. Does it cover everything (i.e. I don't need to worry about what a user enters) or is there a list of characters I should disallow that magic quotes doesn't cover? I'm thinking square brackets, curly brackets, pipe character, etc...
Thanks!