I. Confirm the problem:
Enter the following url: http: // your url/index. php? APP = CAPTCHA & 876589486
An error of the following types occurs: mt_rand (): max (0) is smaller than min (1) or mt_rand (): max (24) is smaller than min (26, then we can take the solution below.
Ii. cause:
Before PHP version 5.3.3, the parameters $ A and $ B passed in by mt_rand ($ A, $ B) have no limit on the number size comparison, but since PHP version 5.3.4, the input parameter must meet $ A <= $ B, that is, the first parameter must be less than or equal to the second parameter. However, according to the current ecmall code, $ A> $ B may occur, so we should avoid this situation.
Iii. Problem Solving:
1) Open the APP/CAPTCHA. App. php (do not use NotePad to open and modify it in DW or another Web Editor)
Set
$ This-> _ CAPTCHA (80, 24 );
Change
$ This-> _ CAPTCHA (80, 26 );
2) Open admin/APP/CAPTCHA. App. php
Set
$ This-> _ CAPTCHA (70, 20 );
To:
$ This-> _ CAPTCHA (70, 26 );
3) Open the replicdes/libraries/CAPTCHA. Lib. php
Set
$ X = mt_rand ($ font [0] ['angle ']> 0? Cos (deg 2rad (90-$ font [0] ['angle ']) * $ font [0] ['zheight']: 1, $ this-> width-$ widthtotal );
Changed:
$ X = mt_rand ($ font [0] ['angle ']> 0? Cos (deg 2rad (90-$ font [0] ['angle ']) * $ font [0] ['zheight']: 0, $ this-> width-$ widthtotal );
Conclusion: we can see that this situation is generally only available in php5.3 or later versions. If you are using php5.2. *, you do not need to consider this solution.