백스테이지 뉴스 표시 기능
1. 새로운 typelist.php 파일을 생성합니다.
코드는 다음과 같습니다.
<?php
header("Content-type:text/html;charset=utf-8");
include 'include/mysqli.php';
?>
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title></title>
<style>
table td{padding: 5px 3px;}
table tr{background: #33CCFF; height: 40px; line-height: 40px}
/*table tr:nth-child(2n){background: #f0f0f0;}*/
</style>
<script>
function delall(){
var arrid="";
obox=document.getElementsByName("box");
for(i=0;i<obox.length;i++){
if(obox[i].checked){
arrid+=obox[i].value+",";
}
}
alert(arrid);
window.location.href="typesave.php?action=delall&arrid="+arrid;
}
</script>
</head>
<body>
<table width="100%">
<tr><td><input type="checkbox">全选</td><td>编号</td><td>类别名称</td><td>排序</td></td><td>操作</td></tr>
<?php
function show($fid,$color,$i){
$i++;
$blank ="";
for($n=0;$n<$i;$n++){
$blank.="---";
}
$rand=array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
$color='#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
global $mysqli;
$sql="select *from type where fid=$fid order by orderid asc";
$result=$mysqli->query($sql);
while($row=$result->fetch_assoc()){
?>
<tr ><td><input type="checkbox" name="box" value="<?php echo $row['id']?>"></td><td><?php echo $row['id']?></td><td><?php echo $blank.$row['typename'].$blank?></td><td><?php echo $row['orderid']?></td><td><a href="typeupdate.php?fid=<?php echo $row['fid']?>&id=<?php echo $row['id']?>">修改</a>
<a href="typesave.php?action=del&id=<?php echo $row['id']?>">删除</a>
<a href="typeadd.php?id=<?php echo $row['id']?>">添加子类</a>
</td></tr>
<?php
// $rand=array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
// $color=$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
show($fid=$row['id'],$color,$i);
}
}
show(0,$color='#33CCFF',0);
?>
<table width="100%" >
<tr style="background: #ffffff">
<td width="10%"></td>
<td width="10%"></td>
<td width="50%"></td><td width="10%"></td>
<td><a href="javascript:delall()">全部删除</a><a href="typeadd.php"> 添加类别</a></td>
</tr>
</table>
</body>
</html>2 화면은 아래와 같습니다.

새로운 파일
<?php
echo "后台新闻展示页面";
시사
Clear
- 코스 추천
- 코스웨어 다운로드
현재 코스웨어를 다운로드할 수 없습니다. 현재 직원들이 정리하고 있습니다. 앞으로도 본 강좌에 많은 관심 부탁드립니다~
이 강좌를 시청한 학생들도 학습하고 있습니다.
PHP로 사업을 시작하는 방법에 대해 간단히 이야기해 보겠습니다.
웹 프론트 엔드 개발에 대한 빠른 소개
민망한 물건 백과사전 사이트를 모방한 Mini 버전 MVC 프레임워크의 대규모 실용 Tianlongbabu 개발
PHP 실용 개발 시작하기: 빠른 PHP 생성 [중소기업 포럼]
로그인 인증 및 클래식 게시판
컴퓨터 네트워크 지식 수집
빠른 시작 Node.JS 정식 버전
당신을 가장 잘 이해하는 프론트엔드 강좌: HTML5/CSS3/ES6/NPM/Vue/...[원본]
자신만의 PHP MVC 프레임워크 작성(깊이 있는 40개 장/자세한 내용/초보자가 발전하려면 읽어야 함)
















