本人刚开始学php,学写代码做留言板,谁帮我看一下为什么写出来的页面中没有“回复”和“删除”的选项???
<?php require_once(“class/database/lydb.class.php”);?>
<?php require_once(“class/service/authority.class.php”);?>
<?php
session_start();
$lydb=new LyDB();
if(isset($_POST[“type”])){
if($_POST[“type”]==”insert”){
if(Authority::check_insert()==true){
$lydb->insert($_POST[“nickname”],”style/avatar/”.$_POST[“avatar”],$_POST[“message”]);
header(“Location:indexy.php”);
exit();
}
}
else if($_POST[“type”]==”login”){
if(isset($_POST[“username”]) && isset($_POST[“password”])){
$dd=User::validate($_POST[“username”],$_POST[“password”]);
if($dd==true){
$_SESSION[“username”]=$_POST[“username”];
header(“Location:indexy.php”);
exit();
}
else{
}
}
}
else if($_POST[“type”]==”reply”){
$id=$_POST[“id”];
$reply=$_POST[“reply”];
$lydb->reply($id,$reply);
header(“Location:indexy.php”);
exit();
}
}
else if(isset($_GET[“type”])){
if($_GET[“type”]==”delete”&& isset($_GET[“id”])){
if(Authority::check_delete()==true){
$lydb->delete_by_id($_GET[“id”]);
header(“Location:indexy.php”);
exit();
}
}
else if($_GET[“type”]==”logout”){
session_destroy();
header(“Location:indexy.php”);
exit();
}
}
header(“Content-Type:text/html;charset=utf-8”);
?>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link rel=”stylesheet” type=”text/css” href=”style/style.css”/>
<script type=”text/javascript” src=”js/jquery-1.7.1.min.js”></script>
<script type=”text/javascript” src=”js/index.js”></script>
<body>
<?php } else {?>
退出
<?php }?>
简单留言本 QQ:1264897620