jpgraph中与生成反垃圾邮件(验证码)相关的一些问题

发布于 2024-11-09 14:58:47 字数 361 浏览 10 评论 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() ;

When I integrate this code into a html file, it shows nothing, but it works when it is separate with the other html code.

So, could any one kindly teach me how to add it to html code and compare the form input with $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() ;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拥有 2024-11-16 14:58:47

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

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

<img src="captcha.php" />

jpgraph returns raw images, you cannot include them in with HTML markup.

instead include the captcha.php as an image in HTML

<img src="captcha.php" />
多情癖 2024-11-16 14:58:47

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

yum install php-gd

这是在 jpgraph_antispam.php 中调用 imagejpeg 所必需的

I struggled with this turned out we had forgotten to intall GD on our linux (Centos) server

yum install php-gd

It was required by the call to imagejpeg in jpgraph_antispam.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文