Forum Moderators: coopster

Message Too Old, No Replies

how to check for no malicous information

         

suresheva31

7:24 pm on Sep 21, 2004 (gmt 0)

10+ Year Member



Hey guys,

I need to pass the hexadecimal only in my query, i need to ensure that no malicous information is passed into $_GET['value'] that could be dangerous to your SQL Query. Help on this please. How do I check for it?

Suresh

httpwebwitch

8:14 pm on Sep 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



check for hexadecimal using a regular expression:

/([A-F0-9][A-F0-9])*/

or use this, if it's supported:

/[:xdigit:]/

coopster

9:00 pm on Sep 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It is indeed supported but you have to use the correct syntax ;)
[[:xdigit:]]
POSIX-Style character-class syntax is available for use only when constructing other character classes (meaning it resides inside an additional pair of square brackets). Otherwise, it is the character class, as in it would be a character class representing the characters ":", "x", "d", "i", "g", "t".

suresheva31, is this what you are concerned about checking? Whether or not the value of a variable contains hexidecimal data?