Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[1002] PHP入門班」目錄
MarkDown
10-5 上課範例:header.php(整合版)
1. PHP入門
2. 使用者輸入介面設計
2-1 上課範例:index.php
2-2 上課範例:save.php
3. PHP變數與常數
3-1 上課範例:a1.php
4. PHP資料類型與建立資料表
4-1 上課範例:add_class.php
5. 連線資料庫及運算元
5-1 上課範例:save_class.php
5-1 上課範例:add_class.php
6. 讀取資料庫及PHP陣列
6-1 上課範例:add_class.php
6-2 上課範例:save_class.php
6-3 上課範例:index.php
7. 編輯與刪除功能
7-1 上課範例:index.php
7-2 上課範例:add_class.php
7-3 上課範例:save_class.php
8. 函數與小強佈景
8-1 上課範例:index.php
8-2 上課範例:add_class.php
8-3 上課範例:save_class.php
9. 流程控制與迴圈
9-1 上課範例:add_class.php
9-2 上課範例:theme.html 樣板檔
9-3 上課範例:save_class.php
9-4 上課範例:index.php
9-5 上課範例:header.php
9-6 上課範例:function.php
10. 練習練習再練習!
10-1 上課範例:index.php
10-2 上課範例:add_class.php
10-3 上課範例:save_class.php
10-4 上課範例:index.php(整合版)
10-5 上課範例:header.php(整合版)
11. 建立學習收藏的發布頁
11-1 上課範例:class.php
11-2 上課範例:header.php
11-3 上課範例:tad0616.sql
11-4 上課範例:blank.php 空白樣板
11-5 上課範例:index.php
12. 兩個資料表的結合
12-1 index.php
13. 資料檢查
13-1 上課範例:index.php
13-2 上課範例:header.php
13-3 上課範例:function.php
13-4 上課範例:class.php
14. 請完成基本功能囉~
14-1 上課範例:index.php(完成版)
15. 認證與session
15-1 上課範例:class.php
15-2 上課範例:config.php
15-3 上課範例:header.php
15-4 上課範例:index.php
16. 分頁與編輯器
16-1 上課範例:index.php
16-2 上課範例:header.php
17. 用PHP上傳檔案
17-1 上課範例:index.php
18. 資料搜尋
18-1 上課範例:index.php
18-2 上課範例:theme.html
11-1 上課範例:class.php
\[1002\] PHP入門班 =============== [](http://www.tad0616.net/uploads/tad_book3/file/1002/11.pdf) ### 一、 請將原來的index.php改為class.php 1. 將程式裡面的index.php 通通改為 $\_SERVER\['PHP\_SELF'\]←這才是好的作法。 2. 將整個程式流程整理出一份空白的檔案,存成 blank.php,日後可以使用。 ### 二、 請建好所需資料表(文章資料表 tncomu\_article)
欄位
資料格式
用途
**sn**
**數字**
**文章編號(流水號)**
stud\_name
文字
作者姓名
content
大量文字
文章內容
post\_time
日期時間
發布時間
enable
單選(1或0)
是否發布(預設為0)
class\_sn
數字
對應班級編號
mode
單選(圖片或文字)
使用掃瞄圖檔或使用者輸入資料來當作內容
text\_passwd
文字
編輯密碼(給作者自己用)
counter
數字
點閱數
### 三、 設計輸入表單 1. 從工具列新增一個「我要撰寫學習收藏」的按鈕或連結,請自己設定一個op值,如write。 2. 將該op值加入switch流程中,並指定當op=article\_form要呼叫出編輯表單函數。 3. 製作編輯表單函數,最後記得用return傳回表單。 4. 表單中,務必用隱藏欄位,自己設定一個op值,也就是送出表單後該進行的動作。如:insert ### 四、 加入儲存功能 1. 在switch中加入op=insert\_article 時要執行的函數,例如 insert\_article(); 2. 完成儲存函數,存入後,進行轉向到首頁的動作:header('location:index.php'); ### 五、 建立首頁預設執行動作 1. 在switch中,加入預設(default)執行的動作,一般來講,就是列出所有文章。 2. 請製作一個list\_article() 函數,用來撈取資料庫中所有文章。
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
62
人線上 (
8
人在瀏覽
線上書籍
)
會員: 0
訪客: 62
更多…