Editing
Web user behavior
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
網站上可能的使用者操作行為、輸入內容 == 使用者操作/使用者輸入的內容 == 使用者輸入內容,包含資料庫內的內容文字。內容可能是 * 空值 ex: 空白、全形空白、NULL、0000-00-00 ** PHP: 陣列元素中的空白值,可用 [http://www.php.net/manual/en/function.array-filter.php array_filter] 函數移除。 ** [https://zh.wikipedia.org/wiki/%E7%A9%BA%E6%A0%BC 空格 - 維基百科,自由的百科全書] * 文字字串間夾雜半形空白、[[Troubleshooting of PHP errors#移除非預期的空白(全形空白) | 全形空白]] * 多行文字間夾雜空白行 * 輸入文字內容的前後有額外的空白。處理方式: ** PHP: 可用 [http://php.net/manual/en/function.trim.php rim] 函數處理。陣列元素值則搭配 [http://php.net/manual/en/function.array-map.php array_map] 函數處理。ex: {{kbd | key = <nowiki>$trimmed_array = array_map('trim' ,$array);</nowiki>}}<ref>[http://stackoverflow.com/questions/5762439/how-to-trim-white-spaces-of-array-values-in-php How to trim white spaces of array values in php - Stack Overflow]</ref> ** jQuery: [http://api.jquery.com/jQuery.trim/ $.trim('string')] * 包含 ASCII 特殊符號 ex: 單引號 ', 雙引號 ", 反斜線 \, 大於小於符號 > < ** 對策: [http://www.php.net/manual/en/function.htmlentities.php PHP: htmlentities - Manual] {{kbd | key=<nowiki>echo htmlentities($str, ENT_QUOTES, "UTF-8");</nowiki>}} ** [[Export MySQL query to Excel file]]: [https://errerrors.blogspot.com/2016/02/navicat.html 解決 Navicat 「存放裝置空間不足,無法完成此操作」問題訊息] 「如果欄位內容是以等號 (=) 、加號 (+)、減號 (-) 或 @ 符號開頭,都會被 (Excel) 視作公式。」而造成錯誤 ** (如果允許輸入多行文字) 包含[[Return symbol | 換行符號]] e.g. {{kbd | key=<nowiki>\r\n</nowiki>}} on {{Win}}, {{kbd | key=<nowiki>\r</nowiki>}} on {{Mac}} & {{kbd | key=<nowiki>\n</nowiki>}} on {{Linux}}<ref>[https://social.msdn.microsoft.com/Forums/zh-TW/47af2197-26b4-4b9e-90e8-bfa9d5cd05b4/what-is-the-deference-between-r-n-and-rn-?forum=csharplanguage What is the deference between What is the deference between \r, \n and \r\n ?!]</ref> ** 可能包含 [[Byte order mark| Byte order mark (BOM)]] (在程式碼編輯器會顯示為「ZWNBSP」) * 混合包含 Unicode 和 ASCII 符號 ** [https://zh.wikipedia.org/zh-tw/%E7%B9%AA%E6%96%87%E5%AD%97 表情圖示] ([[Emoji]]):由 Unicode 符號組成 <ref>[https://stackoverflow.com/questions/39463134/how-to-store-emoji-character-in-mysql-database How to store Emoji Character in MySQL Database - Stack Overflow]</ref> ** 表情符號 ([https://en.wikipedia.org/wiki/Emoticon Emoticon]) 符號,例如 {{kbd | key=<nowiki>゚д゚</nowiki>}}:由 Unicode 或 ASCII 符號組成 * 超出預期的內容長度、內容長度超出預期的版面長度、超出預期的資料數量 * 資料數量從少量變成多量時 * 重複的內容 ex: Excel 欄位重複 * (可勾選多個項目的狀況下) 只勾選了單一項目或者沒有勾選項目,就送出(submit)表單資料 * 可能進行 [https://en.wikipedia.org/wiki/SQL_injection SQL injection] * 可能輸入 HTML 標籤語法,視網站政策決定保留或移除 * 可能輸入 javascript 語法,視網站政策決定保留或移除 使用者操作 * 重複點選按鈕 【建議】點選按鈕一後,將按鈕改為 inactive 狀態,避免重複提交表單資訊。 * 在輸入框內,輸入完文字後,按一次或多次的 {{kbd | key=Enter}} 鍵 ([https://zh.wikipedia.org/zh-tw/%E5%9B%9E%E8%BB%8A%E9%8D%B5 回車鍵]) * 使用 {{kbd | key=Tab}} 鍵,將游標移到下一個輸入框 * 重複修改內容: (1) 建立文件 → 編輯文件 → 儲存文件。 (2) 開啟舊檔文件 → 編輯文件 → 再次儲存文件。 * 編輯文件到一半,不小心手滑,按到「刪除」。【建議】提供復原上一步驟的功能 * 編輯文件到一半,不小心手滑,按到「上一頁」。【建議】提示儲存文件,而避免遺失資料。 上傳檔案 * 上傳不符合格式要求的檔案 * 上傳重複的檔案 使用者環境 * 各種瀏覽器 + 擴充套件 ex: AdBlock。相關頁面: [[User agent]] * 各種設備 <== 模擬 [https://developer.chrome.com/devtools/docs/device-mode Device Mode & Mobile Emulation] for {{chrome}} * 不同網路環境:連線快或慢 <== 模擬 [https://developer.chrome.com/devtools/docs/device-mode#network-conditions Emulating network connectivity] for {{chrome}} == 操作順序 == * 使用者的操作順序,可能不按照功能設計的順序 * 沒有選取任何項目,就提交(submit)或操作表格 == 網頁 UI 元件回饋訊息 == * 操作錯誤時的回饋訊息,例如輸入錯誤帳號密碼的回饋 * 資料儲存變動的回饋訊息,例如資料順利儲存時顯示「儲存成功」 * 搜尋結果的回饋訊息,例如搜尋結果顯示結果筆數 == References == 參考資料 <references/> further reading * [http://www.w3schools.com/php/php_ref_filter.asp PHP 5 Filter Functions] * [https://www.facebook.com/bobchao/posts/10156521037990219 趙柏強 - 哈哈哈前半段聽過後面沒有... 「測試工程師走進酒吧,點了一杯啤酒、點了 0 杯啤酒、點了 99999999999...] 「測試工程師走進酒吧,點了一杯啤酒、點了 0 杯啤酒、點了 99999999999 杯啤酒、點了一隻蜥蜴、點了 -1 杯啤酒、點了 ueicbksjdhd。第一位真正的顧客走進來後,開口就問廁所在哪裡。於是酒吧爆炸燒光,所有人都掛了。」{{access | date=2018-12-06}} * htmlentities<ref>[https://dev.w3.org/html5/html-author/charref Character Entity Reference Chart]</ref> {{Template:Troubleshooting}} [[Category:Web_Dev]] [[Category:PHP]] [[Category:Javascript]] [[Category:Programming]] [[Category:User behavior]] [[Category:Design]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Access
(
view source
) (protected)
Template:Chrome
(
edit
)
Template:Kbd
(
edit
)
Template:Linux
(
edit
)
Template:Mac
(
edit
)
Template:Troubleshooting
(
edit
)
Template:Win
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information