Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从控制器外部提交Cakephp表单_Php_Forms_Cakephp - Fatal编程技术网

从控制器外部提交Cakephp表单

从控制器外部提交Cakephp表单,php,forms,cakephp,Php,Forms,Cakephp,我想让我的用户可以从我的maindomain(不是cakephp应用程序)登录到我的cakephp域 为此,我创建了以下内容: <header> <h2 id="loginHeader">Login</h2> </header> <form id="bloglic-login" action="http://www.myCakeApplication.com/cake2/index.php/user

我想让我的用户可以从我的maindomain(不是cakephp应用程序)登录到我的cakephp域

为此,我创建了以下内容:

      <header>
        <h2 id="loginHeader">Login</h2>
    </header>
    <form id="bloglic-login" action="http://www.myCakeApplication.com/cake2/index.php/users/login" method="post" name="blogliclogin">
        <input id="UserEmail" type="text" placeholder="Email" name="data[User][username]" value="" >
        <input id="UserPassword" type="password" placeholder="Password" name="data[User][password]" value=""/>
        <a class="forgot" href="http://system.bloglic.com/users/forgot_password">Forgot your password?</a>
        <button class="signup" id="button-signup" type="submit">Submit</button>
    </form>
</section>

登录
提交
现在您可以看到,此表单应该通过post请求访问我的usersController和操作登录

但是,当我单击submit时,我得到一个cakephp错误,表示请求已被黑洞

现在我想这是因为我的表格没有遵循蛋糕惯例。但是我如何避免这个错误,让我的用户能够登录呢

im使用Cakephp 2.3版。我还使用ACL来管理我的用户

黑洞来自。要回答您的问题,请阅读“”部分

或者(我不确定),如果你(值得一试)

黑洞是从另一个站点提交的,你可能可以从另一个站点提交。要回答您的问题,请阅读“”部分


或者(我不确定),如果您(值得一试)

假设没有冲突的
SecurityComponent::requireAuth()
SecurityComponent::requireSecure()
SecurityComponent::requireGet()
等,您可能可以从另一个站点提交,然后使用
SecurityComponent::$unlockdactions
,这不仅会禁用
CSRF
检查,也会禁用必要的检查,以便让非CakePHP表单数据通过。假设没有冲突的
SecurityComponent::requireAuth()
SecurityComponent::requireSecure()
SecurityComponent::requireGet()
,等等,然后使用
SecurityComponent::$unlockdactions
应该可以做到这一点,这不仅会禁用
CSRF
检查,而且也会禁用必要的检查,以便让非CakePHP表单数据通过。