
<?php
include_once("functions/is_login.php");
if (!session_id()){//这里使用session_id()判断是否已经开启了Session
	session_start();
}
if(!is_login()){
	echo "请您登录系统后，再访问该页面！";
	return;
}
?>
<?php 
if(isset($_POST["category_id"])){
  $category_id = $_POST["category_id"];}
  include_once("functions/database.php");
  get_connection();
  $result1= mysql_query("select * from news where category_id='category_id'");
  close_connection();
while($row = mysql_fetch_array($result1)){
?>
<tr>
<td>
	<a href="index.php?url=news_detail.php&news_id=<?php echo $row['news_id']?>"><?php echo mb_strcut($row['title'],0,40,"gbk")?></a>
</td>
<?php
if(is_login()){
?>
<td>
	<a href="index.php?url=news_edit.php&news_id=<?php echo $row['news_id']?>">编辑</a>
</td>
<td>
	<a href="index.php?url=news_delete.php&news_id=<?php echo $row['news_id']?>" onclick="return confirm('确定删除吗？');">删除</a>
</td>
<?php
}
?>
</tr>
<?php
}
?>
<?php
$url = $_SERVER["PHP_SELF"];
?>