jpgraph中与生成反垃圾邮件(验证码)相关的一些问题
当我将此代码集成到 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jpgraph 返回原始图像,您不能将它们包含在 HTML 标记中。
而是将 captcha.php 作为图像包含在 HTML 中
jpgraph returns raw images, you cannot include them in with HTML markup.
instead include the captcha.php as an image in HTML
我为此苦苦挣扎,结果我们忘记在 Linux (Centos) 服务器上安装 GD,
这是在 jpgraph_antispam.php 中调用 imagejpeg 所必需的
I struggled with this turned out we had forgotten to intall GD on our linux (Centos) server
It was required by the call to imagejpeg in jpgraph_antispam.php