Ask, about PHP write message board code, how to deal with

Source: Internet
Author: User
Tags php write
For advice, about PHP write message board Code
I just started to learn PHP, learn to write code to do the message board, who help me to see why the page did not write "reply" and "delete" option???



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");
?>




<title>Simple message Book</title>














Administrator Login



You are welcome:
Exit

Simple message Ben qq:1264897620












?>







      $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=" height= "/>"



      Floor

      "class=" Reply_button "> Reply
      The > Delete





      if (Isset ($row ["Reply"]) && trim ($row ["Reply"])! = "") {
      echo "

      ";
      echo "Reply:". $row ["Reply"];
      echo "__". $row ["Retime"]."";
      echo "

      ";

      }
      ?>







Current section Page
Shared Page
Show per page Reviews
Shared Message
"> Previous page
"> Next page
Home
"> Last








@yaokun qq:1264897620


















------to solve the idea----------------------
Too long, not really looking.


"class=" Reply_button "> Reply
The > Delete



should be Authority::check_delete () =false, so the following did not execute, of course no reply and deleted the
------to solve the idea----------------------
Reference:
Administrator Login problems, there is a "delete" and "reply" function can not be implemented. What may be the reason Ah, is not a database connection problem???

That block has permission to verify that your current user in the library does not have permission to both actions
------to solve the idea----------------------
Cache!! It's not possible to delete it!!!
------to solve the idea----------------------
Citation: It's
true, don't know why? It was clean and the Recycle Bin was emptied ...


Do not want you to empty the Recycle Bin, is to delete the browser cache ...
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.