Revision 1371
Added by Dietmar over 13 years ago
calc_image.php | ||
---|---|---|
28 | 28 |
|
29 | 29 |
if(!isset($_SESSION['captcha_time'])) |
30 | 30 |
exit; |
31 |
unset($_SESSION['captcha_time']); |
|
31 |
//unset($_SESSION['captcha_time']);
|
|
32 | 32 |
|
33 | 33 |
// Captcha |
34 |
$_SESSION['captcha'] = ''; |
|
34 |
$sec_id = ''; |
|
35 |
if(isset($_GET['s'])) $sec_id = $_GET['s']; |
|
36 |
$_SESSION['captcha'.$sec_id] = ''; |
|
35 | 37 |
mt_srand((double)microtime()*1000000); |
36 | 38 |
$n = mt_rand(1,3); |
37 | 39 |
switch ($n) { |
38 | 40 |
case 1: |
39 | 41 |
$x = mt_rand(1,9); |
40 | 42 |
$y = mt_rand(1,9); |
41 |
$_SESSION['captcha'] = $x + $y; |
|
43 |
$_SESSION['captcha'.$sec_id] = $x + $y;
|
|
42 | 44 |
$cap = "$x+$y"; |
43 | 45 |
break; |
44 | 46 |
case 2: |
45 | 47 |
$x = mt_rand(10,20); |
46 | 48 |
$y = mt_rand(1,9); |
47 |
$_SESSION['captcha'] = $x - $y; |
|
49 |
$_SESSION['captcha'.$sec_id] = $x - $y;
|
|
48 | 50 |
$cap = "$x-$y"; |
49 | 51 |
break; |
50 | 52 |
case 3: |
51 | 53 |
$x = mt_rand(2,10); |
52 | 54 |
$y = mt_rand(2,5); |
53 |
$_SESSION['captcha'] = $x * $y; |
|
55 |
$_SESSION['captcha'.$sec_id] = $x * $y;
|
|
54 | 56 |
$cap = "$x*$y"; |
55 | 57 |
break; |
56 | 58 |
} |
Also available in: Unified diff
captcha patch (Tks to FrankH)