<a href="<?php echo base_url();?>index.php/registration/invoice/<?php echo ($rows['id']);?>">
function invoice()
{
$paymentid=$this->uri->segment('3');$record=$this->Registration_model->get_data($paymentid);
}
答案 0 :(得分:0)
使用 base64_encode
创建加密IDset DEBUG=my-app & node index.js
答案 1 :(得分:0)
使用base64_encode可以轻松解密。
请将这两个函数添加到帮助程序中以解码id:
function encode_url($string)
{
$CI =& get_instance();
$CI->load->library('encryption');
$ret = $CI->encryption->encrypt($string);
return str_replace(array('+', '/', '='), array('-', '_', '~'),$ret);
}
function decode_url($string)
{
$CI =& get_instance();
$CI->load->library('encryption');
$ret = str_replace(array('-', '_', '~'),array('+', '/', '='),$string);
return $CI->encryption->decrypt($ret);
}
所以你的代码将
<a href="<?php echo base_url();?>index.php/registration/invoice/<?php echo encode_url($rows['id']);?>">
function invoice()
{
$paymentid = decode_url($this->uri->segment('3'));
$record = $this->Registration_model->get_data($paymentid);
}