|
-
Mar 13th, 2004, 05:20 AM
#1
securing POST and GET using expressions
Anyone have a good preg_replace expression or even a different method of securing any variables I might want to? I'm looking to include A-Z, a-z, 0-9, and all of the SHIFT+KEY keys, and not allow any others. So, it's basically only the 'easily typable' keys.
Any help would be appreciated.. I could just make a safe array and do that, but I'm looking for a more efficient way that's only a line or two of code.
I've used this string in Perl before, but I have no idea of how to convert it over to PHP.. I tried a bit, but couldn't get it..
Code:
$str =~ s/[^A-Za-z0-9_]//gs;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|