Troubleshooting of PHP errors: Difference between revisions

Jump to navigation Jump to search
Line 9: Line 9:
使用者輸入內容,內容可能是
使用者輸入內容,內容可能是
* 空值 <== 對策: [http://php.net/manual/en/function.trim.php PHP: trim] 或 jQuery [http://api.jquery.com/jQuery.trim/ $.trim('string')]
* 空值 <== 對策: [http://php.net/manual/en/function.trim.php PHP: trim] 或 jQuery [http://api.jquery.com/jQuery.trim/ $.trim('string')]
* 包含單引號 '
* 包含特殊符號 ex: 單引號 ', 雙引號 ",  > < <== 對策: [http://www.php.net/manual/en/function.htmlentities.php PHP: htmlentities - Manual]
* 包含雙引號 "
* 包含換行符號
* 包含換行符號
* 包含特殊符號 ex: > <
* 內容的前後有空白 (可用[http://php.net/manual/en/function.trim.php trim]函數移除空白)
* 內容的前後有空白 (可用[http://php.net/manual/en/function.trim.php trim]函數移除空白)
* 超出預期的內容長度
* 超出預期的內容長度

Navigation menu