【发布时间】:2013-06-17 17:02:59
【问题描述】:
这种验证码类型是否适用于 PHP 表单?
<?php
session_start();
$text = rand(10000,99999);
$_SESSION["vercode"] = $text;
$height = 25;
$width = 53;
$image_p = imagecreate($width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$white = imagecolorallocate($image_p, 255, 255, 255);
$font_size = 50;
imagestring($image_p, $font_size, 5, 5, $text, $white);
imagejpeg($image_p, null, 80);
?>
然后我让它运行一个以这种方式连接到表单的 IF 语句。
$verify = $_POST['verification'];
if ($verify === $_SESSION['vercode'])
【问题讨论】:
-
不,不是。事实上,我曾经在CTF 比赛中使用Tesseract OCR 绕过某个验证码验证,这比这次更难:-)