【发布时间】:2015-01-06 13:56:30
【问题描述】:
我是 yii 框架的新手,我正在尝试在我的本地 zwamp 环境中执行一个 php 应用程序。该应用程序在生产环境中正常工作。
我收到的错误是在填写表格并尝试提交之后。验证码未验证,我在日志中收到以下错误:
2014/11/10 10:23:17 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system cannot find the action « undefined » that is requested.' in D:\Users\....\web\CController.php:483
Stack trace:
#0 D:\Users\...\web\CController.php(270): CController->missingAction('undefined')
#1 D:\Users\...\web\CWebApplication.php(282): CController->run('undefined')
#2 D:\Users\...\web\CWebApplication.php(141): CWebApplication->runController('site/undefined')
#3 D:\Users\...\base\CApplication.php(180): CWebApplication->processRequest()
#4 D:\Users\....\index.php(23): CApplication->run()
#5 {main}
REQUEST_URI=/appname/site/undefined
HTTP_REFERER=http://localhost:92/appname/site/form
如何解决此问题或确定是哪个操作导致了问题?
**编辑:问题似乎来自这里:验证码与显示的图像不匹配.. **
/**
* Gets the verification code.
* @param boolean $regenerate whether the verification code should be regenerated.
* @return string the verification code.
*/
public function getVerifyCode($regenerate=false)
{
if($this->fixedVerifyCode !== null)
return $this->fixedVerifyCode;
$session = Yii::app()->session;
$session->open();
$name = $this->getSessionKey();
if($session[$name] === null || $regenerate)
{
$session[$name] = $this->generateVerifyCode();
$session[$name . 'count'] = 1;
}
$message = $session[$name];
echo "<script type='text/javascript'>alert('$message');</script>";
return $session[$name];
}
可能是什么问题?
【问题讨论】:
-
你使用CCaptchaAction吗?
-
是的,我正在使用 CCaptchaAction
-
请显示您创建 CCaptcha 小部件和验证规则的代码。
-
添加了相关代码。 $session[$name] 值与显示的图像不匹配
-
Action id 未解析。在此处发布您的控制器/视图/配置代码以更好地了解您的问题