Quote:
Originally Posted by sc0705837
....if they are not it will then check to see if any of the form inputs contain any SQL. I have read in some other places that you can use cfparam or cfqueryparam to stop this but I don't really know how to use them.
-
<cfquery name = "login" datasource="blah">
-
SELECT login, password
-
FROM member
-
WHERE login = '#form.username#' AND password = '#form.password#'
-
</cfquery>
-
It is cfqueryparam. It does not check to see if the inputs contain SQL, but rather _helps_ prevent malicious sql from being executed in the query by enforcing data type rules.
Using cfqueryparam is very simple. The most basic form requires only: "value" and "cfsqltype". The cfsqltype is a string value that represents the data type of your table column. The correct values to use are determined by database type, but some examples are: cf_sql_varchar, cf_sql_integer, etc...
You can find more information about cfqueryparam it in the online documentation
http://livedocs.adobe.com/coldfusion...gs_p-q_18.html -
...
-
FROM member
-
WHERE
-
login = <cfqueryparam value="#form.username#" cfsqltype="cf_sql_varchar"> AND password = <cfqueryparam value="#form.password#" cfsqltype="cf_sql_varchar">
-
-