PHP implementation of the message board function code detailed introduction

Source: Internet
Author: User
Tags php foreach
This small message board function is suitable for the discussion between the class or inside the company, dialogue and message, very convenient, more important is no network, for the management of the company is very happy to common,

Here's how this message board is written:

1 First login page:

<form action= "chuli.php" method= "POST" >    <p style= "margin-left:500px; margin-top:200px     ; height:250px; width:250px ">/* in order to put the login table in the middle of the page, more beautiful * *        

2 Login page After completion to enter the login processing page, that is, the above submitted to the chuli.php

<?phpsession_start (); After login to connect the included login page, open sessioninclude ("DADB.class.php"), $db =new dadb (); $user =$_post["username"]; $pwd =$_post[" Password "]; $sql =" Select password from Yuangong where username= ' {$user} ' "; $arr = $db->query ($sql); if ($arr [0][0]==$ PWD &&!empty ($pwd)) {    $_session["username"]= $user;    Header ("location:main.php");} else{    echo "Login Failed";}? >

, is the login page

3. After the login is completed, it is to enter the main page, that is, to display the conversation you received, the following is the design of the database table and main page code:

<body><p>

4 code to write here, the more important part is completed, the following is to enter the publishing information page, the equivalent of the previous write to add the page, its processing page is not the same as before, the difference is that the current processing page is in the case of user login operation, You need to use the session to connect all the pages in the login situation


This is the PHP implementation of the message board function code details of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.