0

我有以下验证码插件。

我尝试更改不同的字体大小,但没有一个起作用。

谁能告诉我如何更改字体大小。

提前致谢。

编辑:代码在这里

4

3 回答 3

0

这个验证码是垃圾,这个代码写得不好。您应该使用 reCapthca,它非常好而且免费。

我有权说这个 capthca 是垃圾,因为我打破了 capthcas: http ://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-2019 http://web.nvd。 nist.gov/view/vuln/detail?vulnId=CVE-2008-3573 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-2020 http://web.nvd。 nist.gov/view/vuln/detail?vulnId=CVE-2008-3573 (或者至少在 2008 年我做到了 :)

但要真正回答您的问题:在第 127 行,正在生成挑战的长度。将数字 6 更改为您想要的任何值。

    for ($i = 0; $i < 6; $i++)
    {
        $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
    }
于 2010-01-16T18:45:50.937 回答
0

更改这段代码中的字体大小,并为调用输入更高的值mt_rand

if ($use_font == FALSE)
{
    //$font_size = 5;
    $font_size = 15;//For example
    $x = rand(2, $img_width/($length/3));
    // y isnt used here
}
else
{
    // Make font proportional to the image size
   // $font_size  = !empty($font_size) ? $font_size : mt_rand(18,25);
      $font_size  = !empty($font_size) ? $font_size : mt_rand(25,29);//For example
    $x = rand(4, $img_width - (($font_size + ($font_size >> 1)) * $length));
    // y isnt used here
}

还要确保$img_width$img_height足够大,以便更大的字体适合图像。

于 2012-06-14T20:41:04.897 回答
-1

您可能想尝试写下:

$defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_size' => '', 'font_path' => '', 'show_grid' => true, 'skew' => true, 'expiration' => 7200);

以下行

$defaults['font_size'] = 0;

(当然更改0为您想要的大小)

于 2010-01-16T18:44:08.400 回答