natas30
param()
和 quote()
處理使用者輸入的帳號密碼,再字串串接生成 SQL 查詢語句
username=natas31&password="CHA" or 1=1 &password=4
後送出
param()
可以接收多個參數,並會改用 array 回傳
"If the parameter is multivalued (e.g. from multiple selections in a scrolling list), you can ask to receive an array." - FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER
quote()
如果傳入 array 會解析成多個參數,其中第二個參數代表資料型態,i.e., ['"CHA" or 1=1', 4]
因為 4
代表 SQL_INTEGER,導致輸入不會被轉譯成 \"CHA\" or 1=1
,影響生成的 SQL 查詢語句
password=
可以從中任選一個"If
$data_type
is supplied, it is used to try to determine the required quoting behaviour by using the information returned by "type_info". As a special case, the standard numeric types are optimized to return$value
without callingtype_info
." -quote