Text-based visitor check-in book

Source: Internet
Author: User
On the Internet, I saw someone using php + MySQL as a visitor's check-in book. at that time, I thought it was very useful, so I also wanted to create one. However, MYSQL is a little useful, so it creates a text-based visitor check-in book. Its functions are similar to those I have seen on the Internet using MYSQL. here I will publish its source code, hoping it will be helpful to enlarge the user's learning about PHP. It is limited to my own level, and there may be bugs in it. I also hope that my friends will discover it and don't forget to tell me a chance. on the Internet, I saw someone using php + MySQL as a visitor's check-in book, at that time, I felt very useful, so I also wanted to develop one. However, MYSQL is a little useful, so it creates a text-based visitor check-in book. Its functions are similar to those I have seen on the Internet using MYSQL. here I will publish its source code, hoping it will help me to enlarge the user's learning about PHP. It is limited to my own level, and there must be bugs in it. I hope my friends will find it and don't forget to tell me. This check-in book consists of two files: one is the sign.txt file that stores the signed information, which can be created by NOTEPAD; the other is the sign. php file that processes the information. Home page of bamboo garden We have a demo of it. please check it out. Below
Is the source code of sign. php:
Sign. php
If (isset ($ name) & isset ($ msg )){
$ Name = ltrim ($ name );
$ T = date (y, m, d );
$ Dat = "[". $ t. "]";
$ Msg = ltrim ($ msg );
$ Name = trim ($ name );
$ Msg = trim ($ msg );
$ PRistr = $ name. "". $ dat. "". $ msg. "\ n ";
$ F = fopen ("sign.txt", "");
Fwrite ($ f, $ pristr );
Fclose ($ f );
}
$ File = file ("sign.txt ");
If (! Isset ($ pagenum )){
$ Pagenum = 1;
}
$ Lesssign = 0;
$ Num = count ($ file );
$ Dispnumed = 6 * ($ pagenum-1 );
$ Dispnumbeg = $ num-$ dispnumed;
$ Artnumeof1 = 6 * $ pagenum;
$ Isdispnum = $ num-$ artnumeof1;
If ($ isdispnum <= 0 ){
$ Dispnumeof = 1;
$ Lesssign = 1;
}
Else {
$ Dispnumeof = $ isdispnum + 1;
}
$ Sign = 0;
$ Pagec = 0;
For ($ icount = 0; ($ icount <$ num) & ($ sign = 0); $ icount + = 6 ){
For ($ I = 0; $ I <= 6; $ I ++ ){
If ($ icount * 6 + $ I) = $ num ){
$ Sign = 1;
}
}
$ Pagec ++;
}
$ Pagecount = $ pagec;
Echo"









































";$ Fuhao = "◇ ";$ Color = e9eae9;$ Iscolor = 0;$ Lessnum = 5;Echo" ";For ($ I = $ dispnumbeg; $ I >=$ dispnumeof; $ I --){$ Linknum = $ num-$ I;$ Lessnum --;$ Stringmsg1 = $ file [($ i-1)];$ Stringmsg2 = strrev ($ stringmsg1 );$ Stringmsg3 = strstr ($ stringmsg2, "psbn ");$ Stringmsg = strrev ($ stringmsg3 );$ Stringlink = strstr ($ file [($ i-1)], "http ");$ Dispvar = $ fuhao. $ stringmsg;Echo" ";If ($ iscolor = 0 ){$ Color = ffffff;$ Iscolor = 1;}Else {$ Color = e9eae9;$ Iscolor = 0;}}If ($ lesssign = 1 ){For ($ iless = $ lessnum; $ iless> 0; $ iless --){Echo" ";If ($ iscolor = 0 ){$ Color = ffffff;$ Iscolor = 1;}Else {$ Color = e9eae9;$ Iscolor = 0;}}}Echo" ";Echo "";Echo" ";Echo"
";
Echo "bamboo garden check-in book ";
Echo"
";
Echo $ dispvar;
Echo "";
Echo "";
Echo $ stringlink;
Echo "";
Echo"
";
Echo $ fuhao ."
\ N ";
Echo"
";
?>

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.