如果要修改密碼的話
創建 SQL 本地端使用者:
create user 'username'@'localhost' identified by 'password' ;
賦予權限:
grant usage on *.* to 'username'@'localhost' identified by 'password' with max_queries_per_hour 0 max_connections_per_hour 0 max_updates_per_hour 0 max_user_connections 0 ;
新建資料庫:create database [db_name] ;
允許新增使用者操作此資料庫:
grant all privileges on [db_name].* to 'username'@'localhost' with grant option ;
選取資料庫:use [db_name]
更新資料庫權限狀態:FLUSH PRIVILEGES ;
新建資料表:
create table [tb_name] ([Field_name 1] [Field_property 1],[...] [...]) ;
查看資料表:show tables ;
查看資料表欄位:show columns from [tb_name] ;
新增一筆資料:
insert into [db_name].[tb_name] ([field_name 1],[...]) values ("[field_value 1]","[...]") ;
查看資料表內容:select * from [tb_name] [where] [condition] ;
網路下載 epel 6.8 套件:wget [url]
短網址:https://bit.ly/2yWTT7Y
更新安裝:rpm -Uvh [package]
列出所有的套件庫:yum repolist
安裝輔助套件 phpMyAdmin
編輯設定檔
新增允許網路位置
瀏覽頁面
進入管理頁面
設定禁止函數使用
system,exec,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,dl,set_time_limit,passthru,chroot,scandir,chgrp,chown,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen
關閉版本顯示
禁止錯誤訊息顯示:display_errors
記錄起始錯誤:display_startup_errors
同一個檔案,同一行,忽略重覆的錯誤訊息:ignore_repeated_errors
當同一個錯誤,是執行在不同的檔案時産生,忽略此錯誤訊息:ignore_repeated_source
設定時區
設定 session 存在時間
GET | POST | |
---|---|---|
網址差異 | 網址會帶有 HTML Form 表單的參數與資料 | 資料傳遞時,網址並不會改變 |
資料傳遞量 | 由於是透過 URL 帶資料,所以有長度限制 | 由於不透過 URL 帶參數,所以不受限於 URL 長度限制 |
安全性 | 表單參數與填寫內容可在 URL 看到 | 透過 HTTP Request 方式,故參數與填寫內容不會顯示於 URL |
index.html
require_sql.php
login.php
register.php
register.php
Simple Account System Architecture
截圖狀態在web資料夾下
隨便填入資料後以 wireshark 查看 post 封包
index.html 點選 Register 按鈕
填入要註冊的帳號密碼
成功註冊後顯示結果
重複註冊後顯示結果
注意 get 傳輸會顯示在 url
註冊後以 wireshark 查看 get 封包
右鍵點選檢查
註冊完的畫面點選 Home 回到首頁
查看網頁 cookie 狀態
輸入正確帳號密碼後登入
確認 cookie 狀態
返回首頁後依然有 cookie 資料
無需輸入帳密即可再次登入