Php 从url codeigniter获取值参数
您好,我想请求从url获取值参数到我的控制器 我像这样从javascript设置重定向urlPhp 从url codeigniter获取值参数,php,codeigniter,uri,codeigniter-3,request-uri,Php,Codeigniter,Uri,Codeigniter 3,Request Uri,您好,我想请求从url获取值参数到我的控制器 我像这样从javascript设置重定向url window.location.href = '<?php echo base_url().'index.php/form_tambahasset'?>' + '?lang=' + lg + '&lat=' +lt; http://localhost/BTS_CI/index.php/form_tambahasset/lang/107.39410400390625/lat/-6.6
window.location.href = '<?php echo base_url().'index.php/form_tambahasset'?>' + '?lang=' + lg + '&lat=' +lt;
http://localhost/BTS_CI/index.php/form_tambahasset/lang/107.39410400390625/lat/-6.671700384923497
如果我将重定向url设置为这样
window.location.href = '<?php echo base_url().'index.php/form_tambahasset'?>' + '?lang=' + lg + '&lat=' +lt;
http://localhost/BTS_CI/index.php/form_tambahasset/lang/107.39410400390625/lat/-6.671700384923497
它必须是404页未找到
如何获取值参数lang
和lat
?我的$config['uri\u protocol']
现在在请求\u uri
中的位置,但我尝试更改为路径\u信息
它对我不起作用
我尝试了$this->uri->segment(3,0)代码>和parse_str($\u GET['lat'],$\u GET)代码>仍然无法获取我的参数
我的第页,共页
http://localhost/BTS_CI/index.php/form_tambahasset?lang=107.39410400390625&lat=-6.671700384923497
做得很好,但我需要得到我的参数值
我的问题有什么解决办法吗?请帮帮我。谢谢只需查看文档即可
$this->input->get('lang', TRUE); // TRUE is for XSS filtering
$this->input->get('lat', TRUE); // TRUE is for XSS filtering
谢谢,我没有看输入类文档。我只知道不需要声明服务器方法就可以获取param;使用site\u url
而不是base\u url
,请使用以下格式:site\u url('index.php/form\u tambahasset')
。