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)!