PHP开发新闻管理系统之修改页登录

PHP开发新闻管理系统之修改页

修改页面,大家需要注意的是,我们从数据库取出来的信息会存放在表单中,这样我们才可以修改其中的内容

修改页面和添加页面很像,效果图如下:

add.png

代码如下:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
    *{margin:0px;padding:0px;}
    body{background:#ccc;}
    .add{width:450px;height:280px;background:#eee;float:left;}
    .cont{width:500px;height:350px;margin-top:5px;margin-left:5px;}
    form{margin-left:10px;padding-top:30px;}
    .sub{width:100px;height:40px;border:1px solid #ccc;}
    .sub:hover{background:#f90}
    </style>
</head>
<body>
    <div class="add">
        <div class="cont">
            <form method="post" action="modify.php?id=<?php echo $id;?>">
                标题:<input type="text" name="title" value="<?php echo $row['title']?>"></br></br>
                内容:<textarea cols="30" rows="5" name="content"><?php echo $row['content']?></textarea></br></br>
                <input type="submit" value="修改" class="sub">
            </form>
        </div>
    </div>
</body>
</html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{margin:0px;padding:0px;} body{background:#ccc;} .add{width:450px;height:280px;background:#eee;float:left;} .cont{width:500px;height:350px;margin-top:5px;margin-left:5px;} form{margin-left:10px;padding-top:30px;} .sub{width:100px;height:40px;border:1px solid #ccc;} .sub:hover{background:#f90} </style> </head> <body> <div class="add"> <div class="cont"> <form method="post" action="modify.php?id=<?php echo $id;?>"> 标题:<input type="text" name="title" value="<?php echo $row['title']?>"></br></br> 内容:<textarea cols="30" rows="5" name="content"><?php echo $row['content']?></textarea></br></br> <input type="submit" value="修改" class="sub"> </form> </div> </div> </body> </html>
提交重置代码
章节课件