View Single Post
Old 03-24-2006, 06:55 AM   #2 (permalink)
ratbastid
Darth Papa
 
ratbastid's Avatar
 
Location: Yonder
Well, look.... Using regular expressions doesn't magically make your input secure. That would be like saying, I want to make a pie. I have apples. Do apples make a good pie? Like, yes, but there's a whole lot more to it than that.

Anything you could do with a regular expression you could do with a whole bunch of strpos() calls. WAY less efficiently, but... preg_match() is a powerful tool, but it's really just another tool.

There are LOTS of php snippets out there that sanitize inputs. I recommend you google a little bit and see what you find. You really don't want to be rolling your own, when it comes to security. Especially if you're at the stage where you're asking questions like this--no offense, but the question tells me you don't have a huge amount of experience with this. Go find a script written by an expert; it's not smart to take chances with security.
ratbastid is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54