dousha4804 2013-12-31 00:36
浏览 119

聪明的验证码不起作用

I have this problem with smarty, I tried to add a captcha in smarty but I can't see the way of make it work, basically the error comes when i try to show the captcha image, in a normal php file I could embed this php script:

<?php 
    $SampleCaptcha = new Captcha("SampleCaptcha");
    $SampleCaptcha->UserInputID = "CaptchaCode";
    echo $SampleCaptcha->Html();
?>

But for smarty I did this:

$SampleCaptcha = new Captcha("SampleCaptcha");
$SampleCaptcha->UserInputID = "CaptchaCode";
$captcha=$SampleCaptcha->Html();
$sy->assign('captcha', $captcha);

The think is that the variable captcha does print the whole html to show the captcha but when it prints the image attr src it does it in php still.

<img alt="CAPTCHA" src="botdetect.php?get=image&amp;c=samplecaptcha&amp;t=da491a96235a0d9f5fbeb0d7c0accc89" id="SampleCaptcha_CaptchaImage" class="LBD_CaptchaImage">

I tried to use a smarty plugin function but it does the same.

Any expert in smarty may know the answer.

Many thanks.

  • 写回答

1条回答 默认 最新

  • dongyixun0634 2014-01-03 14:07
    关注

    Try this. It may help you as this site has good examples across different platforms.

    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭