dongyi1441 2015-03-21 13:42 采纳率: 100%
浏览 50
已采纳

Codeigniter重定向()和标题[重复]

This question already has an answer here:

After i used form submit my controller make this operation (pseudocode):

form_open('wpis/dodaj','name="form"')
->
wpis (controller)
->
dodaj()
->
[operation with model]
$this -> load -> view('layouts/main')

Works fine but address bar is still www.mysite.com/wpis/dodaj. When i'm using

$this -> load -> view('layouts/main')
redirect() or redirect('mvc')

i get

headers already sent error

How can i run controller mvc in dodaj function, in wpis controller? MVC is my default controller.

</div>
  • 写回答

1条回答 默认 最新

  • dpswo40440 2015-03-21 17:32
    关注

    You don't want to load the view. Only redirect to 'mvc'. Then in 'mvc' controller you have the code to handle this redirection, and load the view.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备