ZIPphp新闻管理系统(简单) 142.62KB

modern358

资源文件列表:

news.zip 大约有34个文件
  1. news/
  2. news/.idea/
  3. news/.idea/inspectionProfiles/
  4. news/.idea/misc.xml 174B
  5. news/.idea/modules.xml 260B
  6. news/.idea/news.iml 281B
  7. news/.idea/workspace.xml 34.58KB
  8. news/admin.php 6.3KB
  9. news/admin_login.php 1.21KB
  10. news/chkadmin.php 1.25KB
  11. news/conn.php 344B
  12. news/css/
  13. news/css/backstage.css 5.79KB
  14. news/css/style.css 6.25KB
  15. news/data/
  16. news/data/news.sql 3.62KB
  17. news/images/
  18. news/images/banner3.jpg 115.5KB
  19. news/index.php 6.1KB
  20. news/loginout.php 179B
  21. news/news_add.php 3.94KB
  22. news/news_del.php 3.79KB
  23. news/news_upd.php 4.8KB
  24. news/newscontent.php 2.3KB
  25. news/saveadd.php 564B
  26. news/savedel.php 294B
  27. news/saveupdate.php 613B
  28. news/type.php 4.88KB
  29. news/type_add.php 2.32KB
  30. news/type_add_save.php 309B
  31. news/type_del.php 2.25KB
  32. news/type_del_save.php 300B
  33. news/type_upd.php 2.71KB
  34. news/type_upd_save.php 359B

资源介绍:

使用XAMPP集成环境(内含Apache+MySQL+PHP),开发工具使用phpstrom,在学习php开发网页时编写的代码,供有需要的朋友下载学习使用。 data文件夹中为数据库导出文件,请使用MySQL或者SqlServer还原后使用。
<?php session_start(); require_once('conn.php'); $key_word = @ $_POST['key_word']; ?> <html> <head> <title>系统后台</title> <link type="text/css" rel="stylesheet" href="css/backstage.css"> </head> <body> <div class="container_bk"> <div class="top_navigation"> <?php if(@ $_SESSION['user_name'] == "") { echo "<script>alert('您还没有登录,请先登录!');history.back();</script>"; exit; } else { $user_name = $_SESSION['user_name']; echo "<span>管理员:[$user_name] 欢迎您!&nbsp;&nbsp;<a href='loginout.php'>注销用户</a></span>"; } ?> </div> <div class="top_banner"> <span>新闻管理系统后台</span> </div> <div class="content_bk"> <div class="content_left"> <div class="news_type"> <table> <tr> <th>新闻管理系统后台中心:</th> </tr> <tr> <td><a href="news_add.php">添加新闻</a></td> </tr> <tr> <td><a href="type_add.php">添加新闻分类</a></td> </tr> <tr> <td>分类/管理</td> </tr> <?php $sql2 = mysqli_query($conn,"SELECT * FROM newstype ORDER BY type_id ASC"); while ($info2 = mysqli_fetch_array($sql2)) { $type_id = $info2['type_id']; $type_name = $info2['type_name']; echo "<tr>"; echo "<td>[$type_name]&nbsp;&nbsp;<a href='type_upd.php?type_id=$type_id'>修改</a> &nbsp;&nbsp;<a href='type_del.php?type_id=$type_id'>删除</a></td>"; echo "</tr>"; } ?> </table> </div> </div> <div class="content_right"> <form name="form1" method="post" action="admin.php"> <span>查询主题:<input type="text" name="key_word" id="key_word" value=""> <input type="submit" name="news_query" id="news_query" value="查 询"></span> </form> <table class="news_list1"> <caption>新闻列表:</caption> <tr> <th class="tb_title">标 题</th> <th class="tb_date">加入时间</th> <th class="tb_detail">详细内容</th> </tr> <?php $sql1 = mysqli_query($conn,"SELECT COUNT(*) AS total FROM news WHERE news_title LIKE '%$key_word%'"); $info1 = mysqli_fetch_array($sql1); $total = $info1['total']; if($total == 0) { echo "本系统暂无任何查询数据。"; exit; } else { $page_size = 10; if($total <= $page_size) { $page_connt = 1; } if(($total % $page_size) != 0) { $page_connt = intval($total/$page_size) + 1; } else { $page_connt = intval($total/$page_size); } if((@ $_GET['page']) == "") { $page = 1; } else { $page = intval($_GET['page']); } $sql1 = mysqli_query($conn,"SELECT * FROM news WHERE news_title LIKE '%$key_word%' ORDER BY news_id ASC LIMIT " .(($page-1)*$page_size).",$page_size"); while($info1 = mysqli_fetch_array($sql1)) { $news_id = $info1['news_id']; $news_title = $info1['news_title']; $news_date = $info1['news_date']; echo "<tr>"; echo "<td class='tb_l'>$news_title</td>"; echo "<td class='tb_c'>$news_date</td>"; echo "<td class='tb_c'><a href='news_upd.php?news_id=$news_id'>修改</a>&nbsp;&nbsp; <a href='news_del.php?news_id=$news_id'>删除</a></td>"; echo "</tr>"; } } ?> </table> <table class="page_list1"> <?php echo "<tr>"; echo "<td>共有数据&nbsp;$total&nbsp;条,每页显示&nbsp;$page_size&nbsp;条; 第&nbsp;$page&nbsp;页/共&nbsp;$page_connt&nbsp;页:&nbsp;"; if($page >= 2) { echo "<a href='admin.php?page=1' title='首页'>&nbsp;首&nbsp;&nbsp;页&nbsp;</a>/<a href='admin.php?page=" .($page-1)."' title='前一页'>前一页</a>&nbsp;&nbsp;"; } if($page_connt >= 2) { for($i=1; $i<=$page_connt; $i++) { echo "<a href='admin.php?page=$i'>&nbsp;$i&nbsp;</a>"; } } if($page >= 2) { echo "<a href='admin.php?page=".(($page+1)>=$page_connt?$page_connt:($page+1)). "' title='后一页'>&nbsp;&nbsp;后一页</a>/<a href='admin.php?page=$page_connt' title='尾页'>尾页</a>"; } echo "</td>"; echo "</tr>"; ?> </table> </div> </div> <div class="footer"> <p>新闻管理系统由modern358@163.com提供,仅供学习,不得用于商业行为,版权所有,违者必究。</p> </div> </div> </body> </html>
100+评论
captcha
    类型标题大小时间
    ZIPjava逆向工具jad.exe191.62KB2月前
    ZIP使用STM32F103C8T6+L298N+MG513P30电机使用外部中断法和输入捕获法进行编码器测速94.78MB2月前
    ZIP使用STM32F103C8T6实现EEPROM(使用AT24C01~AT24C256芯片均可),已经过实物测试2.88MB2月前
    ZIPnode.js(v16.16.0) 安装包26.17MB2月前
    ZIPwiindow安装docker所需的wsl15.86MB2月前
    ZIP代码随想录的pdf版本,需要准备秋招的小伙伴们看过来呀!23.37MB2月前
    ZIPSFML-2.5.1 免费下载16.55MB2月前
    ZIPwps中excel日期控件下载113.27KB2月前