Search code examples
phpcodeignitercodeigniter-2codeigniter-3

I want that id hide and show unique Id in Url using Codeigniter?


<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);
}

Solution

  • Create encrypted id with base64_encode

    <a href="<?php echo base_url();?>index.php/registration/invoice/<?php echo base64_encode($rows['id']);?>">
    
    function invoice()
    {
        $paymentid=base64_decode($this->uri->segment('3'));
        $record=$this->Registration_model->get_data($paymentid);
    }