• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

求教,关于php写留言板代码

php 搞代码 3年前 (2022-01-23) 13次浏览 已收录 0个评论

本人刚开始学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 if(Authority::check_insert()==true){?>

您的昵称:

选择头像:

留言内容:

<?php }// if(Authority::check_insert()==true)
?>

    <?php
    $page_result=$lydb->select_page_result($_GET[“pn”]);
    $result=$page_result[“page_data”];
    //$result=$lydb->select_all_result();
    while($row=mysql_fetch_assoc($result)){
    ?>

  • ” width=”54″ height=”68″ />

    <?php echo $row[“nickname”];?>

    <?php echo $row[“id”];?>楼
    <?php if(Authority::check_delete()==true){?>
    ” class=”reply_button”>回复
    +本文来源gao@daima#com搞(%代@#码网

    搞代gaodaima码

    “>删除
    <?php }?>

    <?php echo $row[“lytime”];?>


    搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
    转载请注明原文链接:求教,关于php写留言板代码

    喜欢 (0)
    [搞代码]
    分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址