单击按钮删除后重定向 [英] Redirect after click button delete

查看:83
本文介绍了单击按钮删除后重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有删除后重定向的问题,我想重定向默认页面但实际上点击删除后重定向其他页面

所以默认页面:

 <   a     href   =  http:// localhost / weekly_report / activity / edit_activity / 172 >  <   / a  >  





所以我的控制器:

公共函数delete_activity_edit()
{

$ id = $ this-> uri-> segment(3);
$ this-> activity-> remove($ id);
redirect(' activity / edit_activity /'); // 我希望我能获得数据172
}





我尝试了什么:



点击按钮删除后,成功但重定向其他页面而不是默认页面什么在我的控制器中添加代码/变量

解决方案

id =


this-> uri-> segment(3 );

这 - >活动 - >清除(

i have problem with redirect after deleted,i want redirect default page but actually after click delete redirect other page
so default page:

<a href="http://localhost/weekly_report/activity/edit_activity/172"></a>



so here my controller:

public function delete_activity_edit()
	{
		
		$id=$this->uri->segment(3);
		$this->activity->remove($id);
		redirect('activity/edit_activity/');//i hope i can get data 172
	}



What I have tried:

after i click button delete,successfull but redirect the other page not default page,what add code/variabel in my controller

解决方案

id=


this->uri->segment(3);


this->activity->remove(


这篇关于单击按钮删除后重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆