jeskel
10-14-2003, 08:25 AM
Hi, 'hope everyone is doing alright
A few weeks ago, I posted a thread about logins and password related to security. Raf helped me with forbidden chars to avoid a sql injection attack:
if InStr("=", login) = True or Instr("*", login) = True or Instr("'",login) = True or Instr("%",login) = True or Instr("_",login) = True then
error = error & "<br />sql injection attack
end if
Now, for different reasons, I'd like to apply that to all my fields, not only the login and password ones. So I could duplicate this code for every field, but I thought that making one function with the chars I want to avoid would be easier. And then I would test my string with this function.
I've been trying a few pathetic things that I won't even show here :o
So then I thought that maybe someone would feel like helping me writing my first function. I don't know if I have to use RegExp to do this or not. I also know that whammy has a "SQLSafe" function but... well... it's a good occasion for me to learn something right here. So if anyone has a few minutes (seconds) to loose, don't hesitate! :thumbsup:
A few weeks ago, I posted a thread about logins and password related to security. Raf helped me with forbidden chars to avoid a sql injection attack:
if InStr("=", login) = True or Instr("*", login) = True or Instr("'",login) = True or Instr("%",login) = True or Instr("_",login) = True then
error = error & "<br />sql injection attack
end if
Now, for different reasons, I'd like to apply that to all my fields, not only the login and password ones. So I could duplicate this code for every field, but I thought that making one function with the chars I want to avoid would be easier. And then I would test my string with this function.
I've been trying a few pathetic things that I won't even show here :o
So then I thought that maybe someone would feel like helping me writing my first function. I don't know if I have to use RegExp to do this or not. I also know that whammy has a "SQLSafe" function but... well... it's a good occasion for me to learn something right here. So if anyone has a few minutes (seconds) to loose, don't hesitate! :thumbsup: