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"/> <input name= "" type= "reset" value= "reset"/>
</div>
</form>
</ul>
</div>
Above is the message page, the effect chart