新闻列表之修改,新增前端页面 登录

新闻列表之修改,新增前端页面

本章介绍的是简单的修改,新增前端的代码。

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <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>
    <style>
 .w414{
            width: 414px;
 }
        .w350{
            width: 350px;
 }
        .h600{
            height: 600px;
 }
        .mr_auto{
            margin: 0 auto;
 }
        .fz{
            font-size: 40px;
 letter-spacing:20px;
 }
        .bg_col{
            background: #ebf8a4;
 }
        .h150{
            height: 80px;
 }
        .pt{
            padding-top: 50px ;
 }
        .bg_col1{
            background: #A6C8FF;
 }
    </style>
</head>
<body>
<div class="w414 mr_auto">
    <div class="bg_col w414 h150">
        <p  style= "text-align:center;" class="fz col">新闻修改页面</p>
    </div>
    <div class="pt bg_col1 w350 h600">
        <form method="post" id="form1" name="form1">
 标题:<input type="text" name="title" value="<?php echo $id?$row['title']:'';?>"><br/><br/>
 内容:<textarea style="width: 250px;height:150px;margin-left: 5px" name="content"><?php echo $id?$row['content']:'';?></textarea><br/><br/>
 作者:<input type="text" name="author" value="<?php echo $id?$row['author']:'';?>"><br/><br/>
            <input style="float: right" type="submit" value="确认修改">
        </form>
    </div>
</div>
</body>
</html>

只是一个简单的跳转页面,需要提一下的就是<form method="post" id="form1" name="form1">,这个是以表单的形式将修改的内容传值到PHP页面,在PHP页面进行接收,再将修改好的内容存到数据库中。

下一节
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <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> <style> .w414{ width: 414px; } .w350{ width: 350px; } .h600{ height: 600px; } .mr_auto{ margin: 0 auto; } .fz{ font-size: 40px; letter-spacing:20px; } .bg_col{ background: #ebf8a4; } .h150{ height: 80px; } .pt{ padding-top: 50px ; } .bg_col1{ background: #A6C8FF; } </style> </head> <body> <div class="w414 mr_auto"> <div class="bg_col w414 h150"> <p style= "text-align:center;" class="fz col">新闻修改页面</p> </div> <div class="pt bg_col1 w350 h600"> <form method="post" id="form1" name="form1"> 标题:<input type="text" name="title" value="<?php echo $id?$row['title']:'';?>"><br/><br/> 内容:<textarea style="width: 250px;height:150px;margin-left: 5px" name="content"><?php echo $id?$row['content']:'';?></textarea><br/><br/> 作者:<input type="text" name="author" value="<?php echo $id?$row['author']:'';?>"><br/><br/> <input style="float: right" type="submit" value="确认修改"> </form> </div> </div> </body> </html>
提交 重置代码
章节 评论 笔记 课件
  • 取消 回复 发送
  • 取消 发布笔记 发送