Ask the PHP experts to help me modify it and get it fully functional. Thank you for dividing the program into three functions 1. The page is displayed after 30 random selections. (No problem) 2. Query function (such as s2) (for example, enter a short word here. A large number of databases are displayed. I want to display only 30 entries here .) 3. Display a single page (such as s3) (you want to add 30 randomly selected items under the same root homepage .) PHPcode & lt ;? Phpset_time_limit (0); $ presc ask the PHP experts to help me modify it to be fully functional. Thank you.
The program has three functions.
1. The page is displayed after 30 random selections. (No problem)
2. Query function (such as s2) (for example, enter a short word here. A large number of databases are displayed. I want to display only 30 entries here .)
3. Display a single page (such as s3) (you want to add 30 randomly selected items under the same root homepage .)
PHP code
"; $ Pf_l. =''; $ Pf_l. ='. $ detail [0].'
'; If (fmod ($ r_num, $ lan) + 1 = $ lan) $ pf_l. =""; $ R_num ++; break ;}}$ pf_l ='Quick brain turns: Find '. $ preference.'. $ r_num. '.
';} Elseif ($ id> 0) {$ dreamdb = file ("date/njjzw. dat "); // read database $ count = count ($ dreamdb); // calculate the number of rows $ detail = explode (" \ t ", $ dreamdb [$ id-1]); $ pf ='Encyclopedia of brain teasers/questions about brain teasers'; $ Pf. ='
Brainstorming: '. $ detail [0].'Http://www.vipcha.net/naojinjizhuanwan/Mjcx.html </SPAN> Answer: '. $ detail [1].' View answer |
';} Else {$ dreamdb = file ("date/njjzw. dat "); // read database $ count = count ($ dreamdb); // calculate the number of rows $ pfl = rand (0, intval ($ count/30 )); for ($ I = $ pfl * 30; $ I <$ pfl * 30 + 30; $ I ++) {if ($ I >=$ count-1) break; $ detail = explode ("\ t", $ dreamdb [$ I]); if (fmod ($ r_num, $ lan) = 0) $ pf_l. =""; $ Pf_l. =''; $ Pf_l. ='. $ detail [0].'
'; If (fmod ($ r_num, $ lan) + 1 = $ lan) $ pf_l. =""; $ R_num ++;} $ pf_l ='We recommend that you use your brains to make quick turns '. $ r_num .'
';}?>
Brainstorming
0 & $ id <= $ count) {echo $ pf;} else {echo $ pf_l;}?>