PHP make message Board one [source code]

Source: Internet
Author: User

Today we talk about using PHP to make a simple message board, first of all to analyze the message board,

First step: Design the database.

The second step: Set the HTML page, is the message page,

The third Step: PHP processing page, save to the database.

Fourth step: Message Display page.

Okay, let's take a look at the first step:

CREATE TABLE IF not EXISTS ' Gx_guestbook ' (
' ID ' int (4) not NULL auto_increment,
' gx_title ' varchar default NULL,
' Gx_content ' Mediumtext,
' Gx_time ' datetime default NULL,
' Gx_tel ' varchar default NULL,
' gx_mail ' varchar default NULL,
' gx_object ' varchar default NULL,
PRIMARY KEY (' id ')
) Engine=innodb DEFAULT charset=gb2312 auto_increment=10;

The above is to create a database there's nothing to say here.

Let's see the second step. Set up HTML Message page

<div id= "Guest" >

<ul>
<form action= "guest_sava.php" enctype= "Multipart/form-data" method= "POST" >
<li><span><input name= "myname" type= "text" id= "myname" size= ""/>
</span> your nickname:</li>
<li><span><input name= "MyMail" type= "text" id= "MyMail" size= ""/>
</span> your email:</li>
<li><span><input name= "Mytel" type= "text" id= "Mytel" size= ""/>
</span> Contact Tel:</li>
<li><span>
<textarea name= "mycontent" cols= "rows=" "7" class= "Case_matter" id= "mycontent" ></textarea>
</span> your message:</li>
<div style= "Clear:both; Text-align:right; height:30px; padding-top:8px; " ><input name= "Submit" type= "Submit" value= "submitted"/>&nbsp; &nbsp;&nbsp; &nbsp; <input name= "" type= "reset" value= "reset"/>
</div>
</form>
</ul>
</div>

Above is the message page, the effect chart

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.