Use PHP to construct a message book. The following describes the configuration: <br/> for convenience of configuration, the code is reorganized, now all the parameters to be set have been placed in config. the configuration instructions are as follows:
For the convenience of configuration, the code has been reorganized. now all the parameters to be set have been put in the config. php file. the configuration should be very simple and detailed descriptions are provided.
Goal: Get your message book in a very short time !!!
1: create a database (to provide database space on the homepage)
The front-end of phpMyAdmin open source Ma is generally available. it is very simple since it was created. after obtaining the name, remember to change $ db_name of config. php to this name.
2: Create a message Table (Change $ table_name of config. php to your name here ).
Structure:
Key_liuyan int (11) auto_increment primary key, // master creation, automatically added
Nikename varchar (20) null // nickname
Subject varchar (100) null // message topic
Date_created varchar (19) // message time
Ip_address varchar (15) // IP address of the contact
Message mediumtext null // message
Email_address varchar (50) null // the email address of the contact
Zhuye_address varchar (50) null // The homepage address of the contact
Huifu_biaozi int (1) default 0 // moderator reply flag
Huifu mediumtext null // moderator reply content
Oicq varchar (20) null // The OICQ number of the contact
You can use the following SQL statement to complete the process !!! (If I pass the test, remember to change yourtable_name to a good note. of course, you can do it without changing it)
3: Create a control table: (put the name here in $ table_name_control of config. php)
The structure is as follows:
Leibie varchar (20) primary key,
Value varchar (20) null
You can also use the following SQL statement:
Create table your_control_table (
Leibie varchar (20) primary key,
Value varchar (20) null
)
Because this is your control table, you must add two control records on your own;
The SQL statement is:
Insert and delete a password:
Insert into your_control_tble (leibie, value)
Values (delete, '20140901 ');
Insert the reply password:
Insert into your_control_tble (leibie, value)
Values (huifu, '123 ');
The password entered here is: 123, and the user name is blank!
How do I calculate the relationship between the password and the inserted value?
That's right. your password, for example, 123 adds up all three digits, equals 6, and then multiply 6 by 222 is the password value !!!
6*222 = 1332.
Now that you know the relationship, you can change it to another password.
However, the username must be blank ,,,
4: after all, you only need to upload the files except readme.txt.
Post. php file
<? Php
Require ('config. php ');
?>
<? Php
$ Nikename = $ arr_request ['nikename'];
If (strlen ($ nikename) = 0)
{
Echo "<center> ";
Echo "Echo "Sorry, <font color = red> it is required </font> !!! Please fill in again! <Br> ";
Echo "Echo "free message book provided by <a href = http://little.oso.com.cn> cubs </a> technical support ";
Echo "</center> ";
Exit;
If (! $ Result ){
Affy_error_exit ('SQL Insert Execution has failed .');
}
Else
{
Echo "<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> ";
Echo "<HTML> <HEAD> <TITLE> Post </TITLE> ";
Echo "<META content =" text/html; charset = gb2312 "http-equiv = Content-Type> ";
Echo "<meta HTTP-EQUIV =" REFRESH "CONTENT =" 2; URL = display. php "> ";
Echo "Echo "<ul> Thank you for posting your message. the message content will be displayed automatically ";
Echo "<br> ";
Echo "<a href = display. php> if your browser does not automatically return to the homepage of the message book ,?
Click here to return .";
Echo "</a> </ul> ";
Exit;
}
?>
Index.html file
<Html>
<Center>
<Title> Thank you for your message! </Title>
<H1> <font color = blue> my message book </font> <Font color = navy> First of all, thank you for your message. I will read every sentence carefully !!! </Font>
<Form action = "post. php" method = "post">
<Table>
<Tr>
<Td> <font color = teal> </font> <font color = red> (cannot be blank) </font> </td> <td>
<Input type = "text" name = "nikename" value = "> </td>
</Tr>
<Tr>
<Td> OICQ number: </td> <td>
<Input type = "text" name = "oicq" value = ""> </td>
</Tr>
<Tr>
<Td> Email: </td> <td>
<Input type = "text" name = "email_address" value = "" size = "30"> </td>
</Tr>
<Tr>
<Td> personal homepage: </td> <td>
<Input type = "text" name = "zhuye_address" value = "http: //" size = "40"> </td>
</Tr>
<Tr> <td>
Topic: </td> <td>
<Input type = "text" name = "subject" size = "40"> </td>
</Tr>
<Tr> <td>
Content: </td>
</Tr>
<Tr> <td colspan = "2">
<Textarea name = "message" cols = "60" rows = "8"> </textarea> </td>
</Tr>
<Tr>
<Td>
<Input type = "submit" value = "complete message">
</Td>
<Td>
<Input type = "reset" value = "coming again">
</Td>
</Tr>
</Table>
</Form>
<P>
<A href = display. php> View message </a>
<Hr> Free message book provided by <a href = "http://little.oso.com.cn"> cubs </a> Technical Support
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.