講義參考用,要活用變化,或許要修改喔~
先準備「連線資料庫的class檔案」放在「shared」資料夾
在「shared」資料夾,準備「新訊的class檔案」
class_news.php
準備「新增新訊」的表單
admin_news.php
在 admin_news.php 檔案中設計新增新訊內容的表單,表單action送到admin_news_process.php。
留意各欄位的 name 名稱。
![](./img/3-4-104.png)
設計下拉式選單選擇新訊分類
admin_news.php
![](./img/3-4-105.png)
class_news.php
![](./img/3-4-106.png)
admin_news.php
![](./img/3-4-107.png)
新增新訊到資料庫
admin_news_process.php >
class_news.php
admin_news_process.php
![](./img/3-4-108.png)
class_news.php
![](./img/3-4-109.png)