【发布时间】:2014-01-03 22:07:54
【问题描述】:
smarty 有这个问题,我尝试在 smarty 中添加验证码,但我看不到让它工作的方式,基本上是当我尝试在普通的 php 文件中显示验证码图像时出现错误可以嵌入这个 php 脚本:
<?php
$SampleCaptcha = new Captcha("SampleCaptcha");
$SampleCaptcha->UserInputID = "CaptchaCode";
echo $SampleCaptcha->Html();
?>
但是为了聪明,我这样做了:
$SampleCaptcha = new Captcha("SampleCaptcha");
$SampleCaptcha->UserInputID = "CaptchaCode";
$captcha=$SampleCaptcha->Html();
$sy->assign('captcha', $captcha);
认为变量 captcha 确实打印了整个 html 以显示验证码,但是当它打印图像 attr src 时,它仍然在 php 中执行。
<img alt="CAPTCHA" src="botdetect.php?get=image&c=samplecaptcha&t=da491a96235a0d9f5fbeb0d7c0accc89" id="SampleCaptcha_CaptchaImage" class="LBD_CaptchaImage">
我尝试使用 smarty 插件功能,但效果相同。
任何聪明的专家都可能知道答案。
非常感谢。
【问题讨论】: