Home >Backend Development >PHP Tutorial >An example of a text guestbook made in PHP (1)_PHP Tutorial
As we all know, the importance of databases to the Internet. Due to the complexity of cgi, asp and php+mysql have become mainstream. Almost all personal web pages use guest books, but the applied guest books are very unstable. This is why Online communication has brought a lot of inconvenience. Therefore, more and more friends want to have their own guestbook.
However, there are very few free personal homepages that support ASP and PHP. The author now recommends Aosuo.com to you. (http://www.oso.com.cn) supports php. This will give you the foundation to have your own guestbook. Now, I will use an example of a text guestbook to describe the simple use of php.
First of all, we first determine the several processes of leaving a message: writing a message, sending, viewing, (searching), etc. And for Bamboo, managing the guestbook is indispensable. In this way, we might as well target 6 PHP File, 1 text file. The 6 php files are: guest.php manage.php reply.php sys.php del.php edit.php, 1 text file is: guest.txt
Let’s take a look at guest first .php content, of course you can directly put the following content into your php web page. Please respect the author's work, thank you.
------------------ ----
//guest.php:
require("sys.php");
if ($B1)
{
if ($message ==="" or $name=="")
{
$errorm="An error occurred!!!Name and message content are required";
}
else
{
#Write data
$space = " ";
$time = date(Y year m month d day H hour i minute);
$ 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 = "