AWS 從 0 到 1

-大於 1 的珍重再見-

本課重點

  • MySQL Server
    • Introduction
    • Using
  • Web Designing
    • Simple Account System

Introduction

一定聽不懂對吧 ?! 😏😏

差不多像是 ......

這樣

然後這樣

再這樣

最後變這樣

的一種概念 🤭🤭

🤪 🤪 🤪 🤪

其實還有一種 .....

有沒有好懂多了 😂😂

現在登入

如果要修改密碼的話

新增使用者

創建 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

編輯設定檔

新增允許網路位置

瀏覽頁面

進入管理頁面

PHP Setting

設定禁止函數使用

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 存在時間

Web Designing

Editor

Editor

今天來簡單製作一個登入系統

先來說說動態網頁

傳遞方式

GET POST
網址差異 ​網址會帶有 HTML Form 表單的參數與資料 資料傳遞時,網址並不會改變
資料傳遞量 由於是透過 URL 帶資料,所以有長度限制 由於不透過 URL 帶參數,所以不受限於 URL 長度限制
安全性 表單參數與填寫內容可在 URL 看到 透過 HTTP Request 方式,故參數與填寫內容不會顯示於 URL

信息儲存方式

  • Session  是在伺服器端保存的一個數據結構,用來跟踪用戶的狀態,這個數據可以保存在集群、數據庫、文件中

 

  • Cookie   是用戶端保存用戶信息的一種機制,用來記錄用戶的一些信息,也是實現Session的一種方式

開始上工

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 資料

無需輸入帳密即可再次登入

Made with Slides.com