Category modification function
1, modify the category display operation page and add a tag here
##Click the a tag to jump
Create a new typeupdate.php file
The code is as follows:<?php
include 'include/mysqli.php';
$id= isset($_GET["id"])?$_GET["id"]:0;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改类别</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<form method="post" action="typesave.php?action=update">
<ul class="typecontent">
<?php
$id=isset($_GET['id'])?$_GET['id']:1;
$sql="select *from type where id='$id'";
$result=$mysqli->query($sql);
$row=$result->fetch_assoc();
?>
<li>父类名称<select name="fid">
<option value="0">根目录</option>
<?php
$fid=$_GET['fid'];
$sql="select *from type where id=$fid order by orderid desc";
$result=$mysqli->query($sql);
while($row=$result->fetch_assoc()){
?>
<option <?php if($row['id']==$fid){echo "selected";}?> value="<?php $row['id']?>"><?php echo $row['typename']?></option>
<?php
}
?>
</select></li>
<?php
$id=$_GET['id'];
$sql1="select *from type where id=$id order by orderid desc";
$result1=$mysqli->query($sql1);
while($row1=$result1->fetch_assoc()){
?>
<li>类别名称<input class="inp" value="<?php echo $row1['typename']?>" type="text" name="typename"></li>
<li>排 序<input value="<?php echo $row1['orderid']?>" class="inp" type="text" name="orderid"></li>
<li><input type="hidden" name="id" value="<?php echo $row1['id']?>">
<input class="btn" type="submit" name="dosub" value="修改"></li>
<?php
}
?>
</ul>
</form>
</body>
</html>Modify the added category page to have an echo function, and after the echo, I don’t know the corresponding Which id needs to be added with a hidden field for processing:


new file
<?php
echo "类别修改功能";
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















