|
2 | 2 | /**
|
3 | 3 | * Created by PhpStorm.
|
4 | 4 | * User: zq199
|
5 | | - * Date: 2016/10/31 |
6 | | - * Time: 23:02 |
| 5 | + * Date: 2016/11/8 |
| 6 | + * Time: 23:29 |
7 | 7 | */
|
8 | 8 | //内容编辑页面
|
9 | 9 | require 'class/system.php';
|
10 | | -require ''; |
11 | | -//主页 |
| 10 | + |
| 11 | +$url = $_SERVER["QUERY_STRING"]; |
| 12 | +$url_parse = explode('=', $url); |
| 13 | +$id = $url_parse[1]; |
| 14 | +//$id = $_POST['id']; |
| 15 | +function get_blog_list($id){ |
| 16 | + $sys_conn1 = new ConnDB(); |
| 17 | + $conn = $sys_conn1->GetConn(); |
| 18 | + mysqli_query($conn,"set names 'utf8' "); |
| 19 | + |
| 20 | + $sql = mysqli_query($conn," select *from tb_blog where id='$id'"); |
| 21 | + $info = mysqli_fetch_array($sql); |
| 22 | + |
| 23 | + return $info; |
| 24 | +} |
| 25 | +$item = get_blog_list($id); |
12 | 26 | ?>
|
13 | 27 | <!DOCTYPE html>
|
14 | 28 | <html lang="en">
|
|
17 | 31 | <title><?php echo SITE_NAME ?>| 编辑文章</title>
|
18 | 32 | <link rel="stylesheet" href="css/bootstrap.min.css">
|
19 | 33 | <link rel="stylesheet" href="css/style.css">
|
| 34 | + <script src="js/jquery.js"></script> |
| 35 | + <script src="js/bootstrap.min.js"></script> |
20 | 36 | <style>
|
21 | 37 | .control-label{
|
22 | 38 | line-height: 34px;
|
|
27 | 43 | <body>
|
28 | 44 | <?php include 'header.php'; ?>
|
29 | 45 | <div class="content col-md-10 col-md-offset-1">
|
30 | | - <div class="add-blog"> |
31 | | - <div class="breadcrumb"><a href="index.php" style="margin-right:5px ">blog</a>\<span style="margin-left: 5px">新建</span></div> |
32 | | - <form class="form-group form-horizontal" action="controller/add_new.php" method="post" name="update-blog-form"> |
| 46 | + <div class="add-blog col-sm-12"> |
| 47 | + <div class="breadcrumb"><a href="index.php" style="margin-right:5px ">文章</a>\<span style="margin-left: 5px"><?php echo $id ?></span></div> |
| 48 | + <form class="form-group form-horizontal" action="controller/update_blog.php" method="post" name="edit-blog-form"> |
| 49 | + <div class="blog_id form-group col-sm-12 clearfix"> |
| 50 | + <label for="blog_id" class="col-sm-1 control-label" style="text-align: left">id:</label> |
| 51 | + <div class="col-sm-11"> |
| 52 | + <input type="text" class="form-control" name="id" id="blog_id" placeholder="<?php echo $item['id'] ?>" /> |
| 53 | + </div> |
| 54 | + </div> |
33 | 55 | <div class="blog_title form-group col-sm-12 clearfix">
|
34 | 56 | <label for="blog_title" class="col-sm-1 control-label" style="text-align: left">标题:</label>
|
35 | 57 | <div class="col-sm-11">
|
36 | | - <input type="text" name="blog_title" id="blog_title" placeholder="请填写标题" /> |
| 58 | + <input type="text" class="form-control" name="blog_title" id="blog_title" placeholder="<?phpecho$item['title'] ?>" /> |
37 | 59 | </div>
|
38 | 60 | </div>
|
39 | 61 | <div class="blog_title form-group col-sm-12 clearfix">
|
40 | 62 | <label for="blog_tag" class="col-sm-1 control-label" style="text-align: left">标签:</label>
|
41 | 63 | <div class="col-sm-11">
|
42 | | - <input type="text" class="form-control" name="blog_tag" id="blog_tag" placeholder="请填写分类或者标签,多个请用英文逗号','分割开" /> |
| 64 | + <input type="text" class="form-control" name="blog_tag" id="blog_tag" placeholder="<?phpecho$item['tag'] ?>" /> |
43 | 65 | </div>
|
44 | 66 | </div>
|
45 | 67 | <div class="form-group col-sm-12 clearfix">
|
46 | 68 | <label for="blog_content" class="control-label" style="padding: 0 15px">内容:</label>
|
47 | | - <textarea class="form-control" rows="6" id="blog_content" name="blog_content" style=""></textarea> |
| 69 | + <textarea class="form-control" rows="6" id="blog_content" name="blog_content" style=""><?phpecho$item['content'] ?></textarea> |
48 | 70 | </div>
|
49 | 71 | <div class="form-group clearfix">
|
50 | 72 | <div class="col-sm-12">
|
|
57 | 79 | <?php include 'footer.php'; ?>
|
58 | 80 | </body>
|
59 | 81 | </html>
|
| 82 | + |
| 83 | + |
| 84 | + |
0 commit comments