前臺數據展示處理方法:
<?php include 'inc/header.inc.php'?>
<div id="main">
<div class="title">父版塊列表</div>
<form method="post">
<table class="list">
<tr>
<th>排序</th>
<th>版塊名稱</th>
<th>操作</th>
</tr>
<?php
$query="select * from sfk_father_module";
$result=execute($link,$query);
while ($data=mysqli_fetch_assoc($result)){
$url=urlencode("father_module_delete.php?id={$data['id']}");
$return_url=urlencode($_SERVER['REQUEST_URI']);
$message="你真的要刪除父版塊 {$data['module_name']} 嗎?";
$delete_url="confirm.php?url={$url}&return_url={$return_url}&message={$message}";
$html=<<<A
<tr>
<td><input class="sort" type="text" name="sort[{$data['id']}]" value="{$data['sort']}" /></td>
<td>{$data['module_name']}[id:{$data['id']}]</td>
<td><a href="#">[訪問]</a> <a href="father_module_update.php?id={$data['id']}">[編輯]</a> <a href="$delete_url">[刪除]</a></td>
</tr>
A;
echo $html;
}
?>
</table>
<input style="margin-top:20px;cursor:pointer;" class="btn" type="submit" name="submit" value="排序" />
</form>
</div>
在這兒還有一系列的處理:
前臺頁面的顯示-->刪除操作的提示(第二次確認)-->操作結果的顯示。
father_module.php confirm.php