We all know the importance of databases for the network. due to the complexity of cgi, asp and php + MySQL have become the mainstream. almost all personal webpages use message books, but the requested message books are unstable. this has caused a lot of inconvenience for online communication. therefore, more and more friends wish to have their own message books.
However, few free personal homepages support asp and php. I recommend the Dynamic Site Guide (http://www.knowsky.com) for php now. this gives you the foundation to have your own message book. now, I will use an example in a text message book to describe the simple use of php.
First, let's determine the process of leaving a message: Write, send, and view the message. (Search) and so on. for Bamboo, it is indispensable to manage message books. in this way, we may wish to locate 6 PHP files and 1 text file. the six PHP files are: guest. php manage. php reply. php sys. php del. php edit. php, 1 text file: guest.txt
Let's take a look at the content of guest. php. Of course, you can directly put the following content on your php webpage. Please respect the work of the author. Thank you.
----------------------
// Guest. php: <?
Require ("sys. php ");
If ($ B1)
{
If ($ message = "" or $ name = "")
{
$ Errorm = "<font color = red> Error !!! </Font> the name and message content are required ";
}
Else
{
# Writing data
$ Space = "& nbsp ;";
$ Time = date (Y, m, D, H, I );
$ Ip = $ REMOTE_ADDR;
$ Name = encode ($ name );
$ Homepage = encode ($ homepage );
$ From = encode ($ from );
$ Email = encode ($ email );
$ Message = StripSlashes ($ message );
$ Message = htmlspecialchars ($ message );
$ Message = check_strlen_long ($ message );
$ Message = nl2br ($ message );
$ Guestcontent = "<tr> <td> <font color = # AB00E1> message content: </font> <br> <! -- Content> $ message <! -- Endcontent> ";
$ Guestcontent = $ guestcontent. "<br> <font color = # 6633FF> The name of the speaker is: </font> <! -- Name> $ name <! -- Endname> ";
If ($ email! = "")
{$ Guestcontent = $ guestcontent. "<br> <font color = # 9900CC> email box </font> <a href ="