In order to enhance the functions on my website, I developed a text-based search based on my website, which is now used on my website. In order to learn and exchange with the majority of users, I am now publishing its source code. the source code is as follows :? Php $ dispstrarray (); $ dispstr [1] disp_ OS .php? Article_id; $ dispstr [2] disp_webma.ph in order to enhance the functions on my website, I developed a text-based search based on my website, it is now used on my own website. To
I learned from each other and communicated with other netizens. I am publishing the source code. the source code is as follows:
$ Dispstr = array ();
$ Dispstr [1] = "disp_ OS .php? Article_id = ";
$ Dispstr [2] = "disp_webma.php? Article_id = ";
$ Dispstr [3] = "disp_webcrea.php? Article_id = ";
$ Dispstr [4] = "disp_program.php? Article_id = ";
$ Dispstr [5] = "disp_create.php? Article_id = ";
$ File = file ("news.txt ");
$ File1 = file ("part.txt ");
$ File2 = file ("number.txt ");
If (! Isset ($ pagenum )){
$ Pagenum = 1;
}
$ Lesssign = 0;
$ Num = count ($ file );
$ Dispnumbeg = 6 * ($ pagenum-1 );;
$ Artnumeof = 6 * $ pagenum;
$ Isdispnum = $ num-$ artnumeof;
If ($ isdispnum <0 ){
$ Dispnumeof = $ num;
$ Lesssign = 1;
}
Else {
$ Dispnumeof = $ artnumeof;
}
$ 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;
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