I am currently implementing a search function from an asp page where the user can input a string (restricted to about 255 chars), from which a dynamic sql statement is constructed.
Eg if they search for "a b c", the script recurses through each word and append the sql to a str which would then be sent to the db. The problem with this method is it is rather easy to hack if you know asp and the way this method works.
Ideally i would use sql server stored procedures to perform the search, but am having a problem on how to parse the user input. I want to be able to search on each word input by the user, but the number of words input is not always fixed (could be 'a b c', 'a b', 'a b c d' etc)
Does anyone know the best way to approach parsing and handling the information? (a temporary db table || send each word individually -> multiple rs's???)
Many thanks in advance.
Nick Hills
Eg if they search for "a b c", the script recurses through each word and append the sql to a str which would then be sent to the db. The problem with this method is it is rather easy to hack if you know asp and the way this method works.
Ideally i would use sql server stored procedures to perform the search, but am having a problem on how to parse the user input. I want to be able to search on each word input by the user, but the number of words input is not always fixed (could be 'a b c', 'a b', 'a b c d' etc)
Does anyone know the best way to approach parsing and handling the information? (a temporary db table || send each word individually -> multiple rs's???)
Many thanks in advance.
Nick Hills