简体   繁体   English

如何在codeigniter中的URI段2之后选择全部?

[英]How to select all after URI segment 2 in codeigniter?

I encoded some data and sent it through url as $this->uri->segment(2) and encoded string contains '/' and other symbols. 我对一些数据进行了编码,并将其作为$this->uri->segment(2)通过url发送,并且编码后的字符串包含'/'和其他符号。 I can not select full URI segment because of those '/' signs. 由于这些“ /”符号,我无法选择完整的URI段。 My main question is, how to select in controller everything after URI segment 1? 我的主要问题是,如何在控制器中选择URI段1之后的所有内容?

$enc_session_email = $this->encrypt->encode($this->session->userdata('email'));

and I get the url result: 我得到的URL结果:

http://localhost/ci/new-affilate/YWwfV9KJrOiY+J08WUcufZkmKbW5ST7wTp+bofnRP35bv/gzvA+5fYo7J6jDCvt0NwzMiEFdU2r3+a8+scqLTA==

How to get all after new-affilate in controller? 如何在控制器中获得新的关联后得到所有?

我认为这样就足够了:

$encoded_string = ltrim($this->uri->ruri_string(), $this->uri->slash_rsegment(1, 'trailing'));

You have to make your URL like this: 您必须将网址设置如下:

http://localhost/ci/new-affilate?enc_session_email=$enc_session_email

and then get it like this: 然后像这样得到它:

$enc_session_email = $this->input->get('enc_session_email', TRUE);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM