0

当我将此代码集成到 html 文件中时,它什么也不显示,但是当它与其他 html 代码分开时它可以工作。

那么,任何人都可以教我如何将其添加到 html 代码中并将表单输入与 进行比较$chars吗?

require_once "/jpgraph/jpgraph_antispam.php";//the location is correct!!

$spam = new AntiSpam();

// saved to $chars for later verification of correct entry

$chars = $spam->Rand(8);

$spam->Stroke() ;
4

2 回答 2

0

jpgraph 返回原始图像,您不能将它们包含在 HTML 标记中。

而是将 captcha.php 作为图像包含在 HTML 中

<img src="captcha.php" />
于 2011-05-26T01:23:25.060 回答
0

我为此苦苦挣扎,结果我们忘记在我们的 linux (Centos) 服务器上安装 GD

yum install php-gd

在 jpgraph_antispam.php 中调用 imagejpeg 需要它

于 2014-05-12T15:12:47.390 回答