1
所以我自制的驗證碼顯示在一條直線上的文字,但我認爲,正因爲如此,該機器人還可以報名 - 他們在獲得改變位置取得驗證碼
可有人告訴我如何修改下面的代碼以添加一個函數或其他可以使每個字母比其他字母更高或更低的函數?請不要介意髒編碼,因爲我不是PHP專業人員。感謝大家的幫助。
$image = imagecreatetruecolor(70, 20);
for ($i=0; $i < rand(20,40); $i++) {
$x = rand(0, 70);
$y = rand(0, 20);
imageline($image, $x, $y, $x+rand(0,10), $y+rand(0,240), imagecolorallocate($image, rand(0,255),rand(0,190),rand(1,90)));
imageline($image, $x, $y, $x+rand(0,11), $y+rand(0,34), imagecolorallocate($image, 255,rand(50,240),rand(241,240)));
}
$s = rand(1, 240);
$x = rand(50, 240);
$f = rand(1, 4);
$d = rand(1, 1);
$c = rand(1, 4);
imagestring($image, $c, 3, $f, $_GET["T"], imagecolorallocate($image, $s,$x,$s));
imagestring($image, $c, 4, $f, $_GET["T"], imagecolorallocate($image, 255,rand(50,240),rand(241,240)));
imagecolortransparent($image, imagecolorallocate($image, 255, 0, 0));
imageinterlace($image);
header("Content-type: image/gif");
imagegif($image);
imagedestroy($image);
耶穌是美麗 - 樂代碼 - 我非常感謝你...從那裏我可以更多地玩,但我的噢,我希望這可以幫助阻止他的傢伙 - 他一直打我多年... 謝謝盧卡斯(光) – DK1 2013-04-27 22:26:13
盧卡斯,會嗎?很難像旋轉一樣e字體也是這樣,它也傾斜了? – DK1 2013-04-27 22:59:04
旋轉你必須創建自己的字體,然後實現它...仔細查看圖像字符串函數[鏈接](http://php.net/manual/en/function.imagestring.php),然後imageloadfont [鏈接] (http://www.php.net/manual/en/function.imageloadfont.php),並與它發揮llbit – 2013-04-28 08:45:19