Home > Article > Backend Development > Guestbook Challenge the best guestbook source code (1)
Instructions for using the guestbook
Haha, I am very happy that I can finally publish the guestbook I have been working on for a long time...
Ah, I hope everyone likes it. It doesn’t matter if you don’t like it, but there must be reasons for not liking it, please let me know. Inform!!!
Thank you!!!
The goal of this guestbook from the beginning is to "challenge the best guestbook"!!! I think "there is nothing impossible, just see if it is necessary"!!!
If your suggestion is good, I will definitely fulfill your request. My goal is: "Be a great programmer".
The advantages and disadvantages of this guestbook:
--------- -------------------------------------------------- -------- This is probably the most important thing. Haha!!! Line breaks are fixed to a certain number of words, which means that no matter what line breaks you make, they will be wrapped for you. This will cause problems if you want to post text graphics.) Most guestbooks now do not implement automatic line breaks, and That is to say, no matter how many characters you write in a sentence, it will be displayed on one line. If there is a message without line breaks, the message book will become ugly, and the line bar under the window will be very long, destroying the leaf surface. Beautiful!!!.
As of today, I haven’t found a message that can solve these two problems at the same time, which is why I wrote this guestbook.
Including oso forums, they also don’t have line breaks. If you don’t believe me, go here Try leaving a message, write a very long character without a carriage return, and problems will appear on its leaves immediately. (I mentioned this problem to oso, I don’t know if it has been changed!)
I wrote a computer_message($ msg); function solves this problem, you can see the source code in the config.php file.
There is also pagination: there are two ways to view it, one is: display messages forward and backward, and the other is: install The page number is displayed.
Moderators can now easily delete and restore through the link below, and of course they have to enter a password.
Disadvantages:
Of course there is, but be realistic, but the page beautification work is not enough. Although I think it is necessary, due to time constraints, I always feel that this is an external thing. You can drag it first. Of course, anyone with a little knowledge of HTML can easily modify it.
There are also unknown BUGs! Haha! !!
The download point and samples can be found at http://little.oso.com.cn! ! !
Because the description file is written under Linux, you need to use WordPad to open readme.txt
Don’t use Notepad, otherwise the code will be garbled! ! !
The following are configuration instructions:
------------------------------------------------- --------------------------
For the convenience of configuration, the code has been rearranged. Now all the parameters that need to be set are placed in
config .php file, it should be very simple to configure, and there are detailed instructions in it.
Goal: Complete your guestbook within ten minutes!!!
1: Establish a database (the homepage must provide database space)
Generally like oso has the phpMyAdmin open source front-end. It has been very simple since its creation.
After choosing a name, remember to change the $db_name of config.php to this name
2: Create a message table (change the $table_name of config.php later) Change it to the name you gave here).
The structure is:
key_liuyan int(11) auto_increment primary key, // Mainly built, automatically increase
nikename varchar(20) null )null Theme _ Date_created Varchar (19) // Message time
ip_address varchar (15) // The message of the message
Message Mediumtext Null // Message Information
Email_Address Varchar (50) null // Zhuye_address varchar(50) null ’s homepage address . // Moderator’s reply content
oicq varchar(20) null
You can use the following SQL to complete!!! (I passed the test, remember to change yourtable_name to something easier to remember,
Of course, it’s okay if you don’t change it)
create table your_liuyan_table(
key_liuyan int(11) auto_increment primary key,
nikename varchar(20) null,
subject varchar(100) null,
date_created varchar(19),
ip_address varchar(15),
message mediumtext null,
email_address varchar(50) null,
zhuye_address varchar(50) null,
huifu_biaozi int(1) default 0,
huifu mediumtext null,
oicq varchar(20) null
)
3: Create a control table: (Also put the name here in $table_name_control of config.php)
The structure is as follows:
varchar(20) primary key,
varchar(20) .
)
Because this is your control table, you need to add two control records yourself;
The SQL statement is:
Insert into your_control_tble(
leibie,
value)
values
(delete,'1332 ') ;
Insert reply password:
insert into your_control_tble(
leibie,
value)
values
(huifu,'1332');
The password put in is: 123, and the user name is empty!
How to calculate the relationship between the password and the inserted value?
Yes In this way, your password, such as 123, add up the three digits, equals 6, and then multiply 6 by 222 to get the password value!!!
6*222=1332.
Knowing this relationship, of course you can Changed to another password.
But the user name must be empty,,,
The principle of simple encryption can be referred to the three-digit number on the homepage http://cxg168.126.com.
4: Everything is completed, and then Just upload the files except readme.txt.
If you have any questions, please contact me.
Here are the ways to contact me (return comments):
-------------- -------------------------------------------------- ----
?My guestbook: http://little.oso.com.cn
My OICQ: 873221
My e-mail: cxg168@sohu.com
--------- -------------------------------------------------- ----------
The above introduces the source code of the guestbook challenge for the best guestbook (1), including the content of the guestbook. I hope it will be helpful to friends who are interested in PHP tutorials.