[英]cakePHP redirect to blank page only in online domain but localhost working good
I'm using redirect method in cakePHP to navigate from page to another and in add page when I press submit button it should send data to database and redirect to index view but it didn't and show in URL it's going to samePage/add but it should go to just samePage, not samePage/add again. 我在cakePHP中使用重定向方法从页面导航到另一个页面,并在我按提交按钮时在添加页面中将数据发送到数据库并重定向到索引视图,但是没有显示在URL中,它会指向samePage / add,但是它应该去的只是samePage,而不是samePage / add。
This issue happened only on online version but in localhost, everything does well. 此问题仅发生在联机版本上,但在localhost中,一切正常。
I'm using the same code on all pages 我在所有页面上都使用相同的代码
return $this->redirect('/Boardmembers');
it works online but only on one page. 它可以在线运行,但只能在一页上显示。 All the pages except this boardmembers page when I redirect it's going to blank age and on URL pageName/add again.
当我重定向时,除该董事会成员页面外的所有页面都将变为空白年龄,并再次出现在URL pageName / add上。
I'm trying another format of typing URL in redirect method like 我正在尝试在重定向方法中键入URL的另一种格式,例如
$this->redirect(array('action' => 'index'));
return $this->redirect(array('controller'=>'Boardmembers','action' => 'index'));
but no one working except boardmembers page. 但除董事会成员页面外,没有人在工作。
and this error only in online domain 而且此错误仅在在线域中
解决方案是删除PHP开始和结束标记“”之前的所有空白
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.