我想隐藏url的get参数
我有URL像domain.com/controller/function?clear=1
我想从URl中删除?clear=1,并希望URl如下: domain.com/controller/function
在codeigniter中是可能的,但是如何实现呢?我在这里看到了一些类似的问题,但是我找不到合适的解决方法。
不能隐藏get参数。您可以使用ajax发送如下参数
var id = "your parameter which you want to send in the url";
$.ajax({
url:"<?php echo site_url('controller/function');?>/"+id,
success:function(data)
{
}
});
}
尝试更多链接
您可以在发送数据之前使用base64_encode
,当您在控制器base64_decode
中捕获数据时
编码示例&解密加密PHP
在
<a href="<?php echo base_url()?>Controller_name/Method/<?php base64_encode('Im the value')?>"
在控制器public function Method($id)
{
$valid_id = base64_decode($id);
}