Effect display of PHP development article publishing system
Project Goals
This project is mainly to develop a simple article publishing system, its main functions are
1. Check the addition, deletion and modification of articles in the background
2. Article list and article details in the front desk
##The effect achieved by the project
Backstage article management page:
<html><head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no"> <title>文章管理</title> <meta charset="utf-8"> <style> .box{ background-color:#f0f0f0; } .title{ margin:0 auto; border:1px solid black; width:400px; } .middle{ margin:0 auto; border:1px solid black; width:400px; } .menu{ margin:-50px 0px 1px 319px; width:80px; } .content{ clear:both; } .art{ text-align:center; } .num{ float:left; border:1px solid black; width:50px; font-size: 13px; } .tit{ float:left; border:1px solid black; width:274px; font-size: 13px; } .act{ float:left; border:1px solid black; width:70px; font-size: 13px; } .bottom{ width:400px; margin:0 auto; border:1px solid black; clear:both; } </style> </head> <body> <div class="box"> <div class="title"><h1>后臺管理系統(tǒng)</h1> <div class="menu"> <a href="admin_add.php">發(fā)布文章</a><br> <a href="admin_manage.php">管理文章</a> </div> </div> <div class="middle"> <div class="art">文章管理列表</div> <div class="num">編號</div> <div class="tit">標題</div> <div class="act">操作</div> <div class="content"> <div class="num">28</div> <div class="tit">Facebook 將 PHP 編譯成 JVM 字節(jié)碼?</div> <div class="act"> <a href="admin_modify.php?id=28">修改</a> <a href="admin_del_handle.php?id=28">刪除</a> </div> <div class="num">27</div> <div class="tit">PHP 5.5 或?qū)⒁?nbsp;Generators</div> <div class="act"> <a href="admin_modify.php?id=27">修改</a> <a href="admin_del_handle.php?id=27">刪除</a> </div> <div class="num">26</div> <div class="tit">國外十大最流行PHP框架排名</div> <div class="act"> <a href="admin_modify.php?id=26">修改</a> <a href="admin_del_handle.php?id=26">刪除</a> </div> <div class="num">25</div> <div class="tit">php接收標準輸入解決分布式處理實現(xiàn)方法</div> <div class="act"> <a href="admin_modify.php?id=25">修改</a> <a href="admin_del_handle.php?id=25">刪除</a> </div> <div class="num">24</div> <div class="tit">PhpStorm 6 發(fā)布,PHP 集成開發(fā)環(huán)境</div> <div class="act"> <a href="admin_modify.php?id=24">修改</a> <a href="admin_del_handle.php?id=24">刪除</a> </div> <div class="num">23</div> <div class="tit">PHP閉包(Closure)初探</div> <div class="act"> <a href="admin_modify.php?id=23">修改</a> <a href="admin_del_handle.php?id=23">刪除</a> </div> <div class="num">22</div> <div class="tit">為什么 PHP 應該使用 PDO 方式訪問數(shù)據(jù)庫</div> <div class="act"> <a href="admin_modify.php?id=22">修改</a> <a href="admin_del_handle.php?id=22">刪除</a> </div> <div class="num">21</div> <div class="tit">PHP5.5 + Apache2.4.4 初體驗(64位)</div> <div class="act"> <a href="admin_modify.php?id=21">修改</a> <a href="admin_del_handle.php?id=21">刪除</a> </div> <div class="num">20</div> <div class="tit">Nginx 上的 php-fpm 資源侵占問題</div> <div class="act"> <a href="admin_modify.php?id=20">修改</a> <a href="admin_del_handle.php?id=20">刪除</a> </div> <div class="num">19</div> <div class="tit">PHP開發(fā):從程序化到面向?qū)ο缶幊?lt;/div> <div class="act"> <a href="admin_modify.php?id=19">修改</a> <a href="admin_del_handle.php?id=19">刪除</a> </div> <div class="num">18</div> <div class="tit">動態(tài)網(wǎng)頁制作PHP常用的正則表達式</div> <div class="act"> <a href="admin_modify.php?id=18">修改</a> <a href="admin_del_handle.php?id=18">刪除</a> </div> <div class="num">15</div> <div class="tit">動態(tài)語言正成為開發(fā)者的重要工具</div> <div class="act"> <a href="admin_modify.php?id=15">修改</a> <a href="admin_del_handle.php?id=15">刪除</a> </div> <div class="num">13</div> <div class="tit">用PHP編程語言開發(fā)動態(tài)WAP頁面</div> <div class="act"> <a href="admin_modify.php?id=13">修改</a> <a href="admin_del_handle.php?id=13">刪除</a> </div> </div> </div> <div class="bottom"> 歡迎聯(lián)系我們<a href="http://ipnx.cn">php中文網(wǎng)</a><br> 前臺展示頁面<a href="../home/home_list.php">php咨詢站</a> </div> </div> </body></html>
Backstage article publishing page:
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no" /> <title>發(fā)布文章</title> <meta charset="utf-8" /> <style> .box{ background-color:#f0f0f0; } .title{ background-color:#f0f0f0; width:400px; height:100px; border-bottom:1px solid black; } .menu{ margin:-25px 0px 1px 319px; width:80px; } .middle{ border-bottom:1px solid black; } .bottom{ } </style> </head> <body> <div class="box"> <div class="title"> <h1>后臺管理系統(tǒng)</h1> <div class="menu"> <a href="admin_add.php">發(fā)布文章</a><br/> <a href="admin_manage.php">管理文章</a> </div> </div> <div class="middle"> <form method="post" action="admin_add_handle.php"> <div><h2>發(fā)布文章</h2></div> <div>標題:<input type="text" name="title" /></div><br/> <div>作者:<input type="text" name="author" /></div><br/> <div>簡介:<br/><textarea name="description" cols="50" rows="4"></textarea></div><br/> <div>內(nèi)容:<br/><textarea name="content" cols="50" rows="9" ></textarea></div><br/> <div><input type="submit" name="button" value="提交" /></div><br/> </form> </div> <br/><div class="bottom">歡迎聯(lián)系我們<a href="http://ipnx.cn">php中文網(wǎng)</a></div> </div> </body> </html>
Backend article modification page:
<?php require_once("../connect.php"); $id=$_GET['id']; $sql="select * from article where id=$id"; $query = mysqli_query($conn,$sql); $data = mysqli_fetch_assoc($query); ?> <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no" /> <title>發(fā)布文章</title> <meta charset="utf-8" /> <style> .box{ background-color:#f0f0f0; } .title{ background-color:#f0f0f0; width:400px; height:100px; border-bottom:1px solid black; } .menu{ margin:-25px 0px 1px 319px; width:80px; } .middle{ border-bottom:1px solid black; } </style> </head> <body> <div class="box"> <div class="title"> <h1>后臺管理系統(tǒng)</h1> <div class="menu"> <a href="admin_add.php">發(fā)布文章</a><br/> <a href="admin_manage.php">管理文章</a> </div> </div> <div class="middle"> <form method="post" action="admin_modify_handle.php"> <input type="hidden" name="id" value="<?php echo $data['id']?>" /> <div><h2>修改文章</h2></div> <div>標題:<input type="text" name="title" value="<?php echo $data['title']; ?>"/></div><br/> <div>作者:<input type="text" name="author" value="<?php echo $data['author']; ?>"/></div><br/> <div>簡介:<br/><textarea name="description" cols="50" rows="4"><?php echo $data['description']; ?></textarea></div><br/> <div>內(nèi)容:<br/><textarea name="content" cols="50" rows="9" ><?php echo $data['content']; ?></textarea></div><br/> <div><input type="submit" name="button" value="提交" /></div><br/> </form> </div> <br/><div class="bottom">歡迎聯(lián)系我們<a href="http://ipnx.cn">php中文網(wǎng)</a></div> </div> </body> </html>
Front-end article list page:
<html><head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no"> <title>文章列表</title> <meta charset="utf-8"> <style> *{ box-sizing:border-box; } .box{ font-family: 宋體; margin:0px auto; width:400px; } .box a:link,.box a:visited,.box a:hover{color:#000000;text-decoration:underline; } .head{ background-color:#0f8ff2; height:80px; } .tit{ padding: 20px 20px; font-size:25px; } .content{ width:400px; min-height:100px; border:1px solid red; } .top_con{ width:400px; padding:10px; } .bottom_con{ margin-left:20px; width:400px; } .con_tit{ font-size:18px; margin:10px 0px 10px 10px; font-weight:bold; } .con_des{ text-indent:2em; font-size:18px; } .con_det{ padding: 0px 0px 0px 300px; } ul{ list-style:none; margin-left:-40px; } li{ margin:15px 0px 0px 0px; } .index{ margin:-5px 0px 0px 0px ; } .bg{ position:relative; top: -6px; background-color:#fff; margin-left:335px; } </style> </head> <body> <div class="box"> <div class="head"><div class="tit">php資訊站</div><span class="bg"><a href="../admin/admin_manage.php">后臺入口</a></span></div> <div class="content"> <div class="top_con"> <div class="con_tit">用PHP編程語言開發(fā)動態(tài)WAP頁面</div> <div class="con_des">WAP(無線通訊協(xié)議)是在數(shù)字移動電話、個人手持設(shè)備(PDA等)及計算機之間進行通訊的開放性全球標準協(xié)議。隨著無線通訊的不斷發(fā)展,靜態(tài)的WAP頁面在很多方面已經(jīng)不能滿足用戶個性化的要求,因此開發(fā)者可以在WAP服務 </div> <div class="con_det"><a href="home_show.php?id=13">查看詳細</a></div> <div class="con_tit">動態(tài)語言正成為開發(fā)者的重要工具</div> <div class="con_des">曾經(jīng)程序語言世界里的二等公民,腳本語言(也叫動態(tài)語言)正成為開發(fā)者的重要工具。</div> <div class="con_det"><a href="home_show.php?id=15">查看詳細</a></div> <div class="con_tit">動態(tài)網(wǎng)頁制作PHP常用的正則表達式</div> <div class="con_des">正則表達式用于字符串處理、表單驗證等場合,實用高效</div> <div class="con_det"><a href="home_show.php?id=18">查看詳細</a></div> <div class="index"> <a href="home_list.php?page=1">首頁</a> <a href="home_list.php?page=0">上一頁</a> <a href="home_list.php?page=2">下一頁</a> <a href="home_list.php?page=5">末頁</a> </div> </div> <div class="bottom_con"> <div style="margin-left:10px;margin-top:20px,font-size:20px;">最新資訊</div> <ul> <li><a href="home_show.php?id=28">Facebook 將 PHP 編譯成 JVM 字節(jié)碼?</a></li> <li><a href="home_show.php?id=27">PHP 5.5 或?qū)⒁?nbsp;Generators</a></li> <li><a href="home_show.php?id=26">國外十大最流行PHP框架排名</a></li> <li><a href="home_show.php?id=25">php接收標準輸入解決分布式處理實現(xiàn)方法</a></li> <li><a href="home_show.php?id=24">PhpStorm 6 發(fā)布,PHP 集成開發(fā)環(huán)境</a></li> <li><a href="home_show.php?id=23">PHP閉包(Closure)初探</a></li> </ul> </div> </div> </div> </body></html>
Front-end article details page :
<html><head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no"> <title>文章列表</title> <meta charset="utf-8"> <style> *{ box-sizing:border-box; } .box{ font-family: 宋體; margin:0px auto; width:400px; } .box a:link,.box a:visited,.box a:hover{color:#000000;text-decoration:underline; } .head{ background-color:#0f8ff2; height:80px; } .tit{ padding: 20px 40px; font-size:25px; } .content{ width:400px; min-height:100px; border:1px solid red; } .top_con{ width:400px; padding:5px 10px 20px 10px ; } .bottom_con{ margin:0px 0px 0px -1px; width:400px; } .con_tit{ font-size:22px; margin:20px 0px 10px 10px; font-weight:bold; } .con_aut{ font-size:13px; padding-left:10px; padding-top:10px; } .con_des{ padding-top:15px; text-indent:2em; font-size:18px; padding-left:10px } .con_det{ text-indent:2em; font-size:17px; margin:20px 0px 0px 0px; padding-left:10px } ul{ list-style:none; margin-left:-30px; } li{ margin:15px 0px 0px 0px; } </style> </head> <body> <div class="box"> <div class="head"><a href="home_list.php">返回</a><div class="tit">php資訊站</div></div> <div class="content"> <div class="top_con"> <div class="con_tit">用PHP編程語言開發(fā)動態(tài)WAP頁面</div> <div class="con_aut">php中文網(wǎng) 發(fā)表于2016-11-01</div> <div class="con_des">WAP(無線通訊協(xié)議)是在數(shù)字移動電話、個人手持設(shè)備(PDA等)及計算機之間進行通訊的開放性全球標準協(xié)議。隨著無線通訊的不斷發(fā)展,靜態(tài)的WAP頁面在很多方面已經(jīng)不能滿足用戶個性化的要求,因此開發(fā)者可以在WAP服務 </div> <div class="con_det">WAP(無線通訊協(xié)議)是在數(shù)字移動電話、個人手持設(shè)備(PDA等)及計算機之間進行通訊的開放性全球標準協(xié)議。隨著無線通訊的不斷發(fā)展,靜態(tài)的WAP頁面在很多方面已經(jīng)不能滿足用戶個性化的要求,因此開發(fā)者可以在WAP服務器端使用諸如PHP等語言產(chǎn)生動態(tài)的WML頁面,來滿足用戶的需要。 WAP的應用結(jié)構(gòu)非常類似于Internet,一個典型的WAP應用請求步驟描述如下: 1. 具有WAP用戶代理功能的移動終端(如WAP手機),通過內(nèi)部運行的微瀏覽器向某一網(wǎng)站發(fā)送WAP服務請求。該請求先由WAP網(wǎng)關(guān)截獲,對信息內(nèi)容進行編碼壓縮,以減少網(wǎng)絡數(shù)據(jù)流量,同時根據(jù)需要將WAP協(xié)議轉(zhuǎn)換成HTTP協(xié)議。 2. 協(xié)議將處理后的請求轉(zhuǎn)送到相應WAP服務器。在WAP服務器端,根據(jù)頁面擴展名等屬性,被請求的頁面直接或由服務器端腳本解釋后輸出,再經(jīng)過網(wǎng)關(guān)傳回給用戶。 從上述的WAP應用流程可以發(fā)現(xiàn),生成動態(tài)WAP頁面與動態(tài)產(chǎn)生Web網(wǎng)頁的過程非常相似。但是由于WAP應用使用的WML語言來源于語法嚴格的XML,因此要求輸出的格式必須按WAP網(wǎng)頁的規(guī)范輸出。同時,由于WAP協(xié)議的應用范圍及移動客戶端的軟、硬件配置等局限性,對每次輸出的頁面的大小、圖像的格式及容量都有一定限制。本文筆者將以PHP語言為例,和廣大網(wǎng)絡程序開發(fā)愛好者共同探討動態(tài)輸出WAP頁面的方法和應用。 輸出簡單的動態(tài)WAP頁面 由于生成WAP頁面的過程和生成一般的Web頁面非常類似,筆者通過一個最簡單的WAP頁面的例子來介紹。不過提醒一句:由于需要PHP解釋器來解釋該程序并輸出WAP頁面,因此所有類似的程序應以“php”為擴展名哦。 該實例可以在WAP手機模擬器中瀏覽,輸出一句經(jīng)典的“Hello WAP”語句,但是在普通的網(wǎng)絡瀏覽器中是無法識別的,原因很簡單,在程序開頭聲明了該輸出文檔為WML類型,只有WAP設(shè)備能夠識別并解釋。不過又要提醒一句:常見的HTML語言對規(guī)范性要求不嚴,大多數(shù)瀏覽器能“寬容”地接受其中的編寫錯誤,但是WML的規(guī)范相當嚴格,任何的錯誤都可能導致無法輸出所需的頁面。</div> </div> <div class="bottom_con"> <div style="margin-left:10px;font-size:20px;">最新資訊</div> <ul> <li><a href="home_show.php?id=28">Facebook 將 PHP 編譯成 JVM 字節(jié)碼?</a></li> <li><a href="home_show.php?id=27">PHP 5.5 或?qū)⒁?nbsp;Generators</a></li> <li><a href="home_show.php?id=26">國外十大最流行PHP框架排名</a></li> <li><a href="home_show.php?id=25">php接收標準輸入解決分布式處理實現(xiàn)方法</a></li> <li><a href="home_show.php?id=24">PhpStorm 6 發(fā)布,PHP 集成開發(fā)環(huán)境</a></li> <li><a href="home_show.php?id=23">PHP閉包(Closure)初探</a></li> </ul> </div> </div> </div> </body></html>We will introduce each page in detail later. In the next section we will introduce the file composition of the entire project