문제

It is the first time I want to use encrypt class.I need to encrypt a value from view and send it as a parameter of a function in controller.In controller I do this:

$this->load->library('encrypt');   

in view I have this link:

<a href="<?php echo base_url()?>/article_cont/show_public/<?php $this->encrypt->encode($row->art_id)?>">continue</a>     

when I click on this link it goes to show_public function in controller but does not pass the parameter to this function.what is the problem?
Thanks for your help.

도움이 되었습니까?

해결책

You forget to print it out.

Just:

<a href="<?php echo base_url()?>/article_cont/show_public/<?php echo $this->encrypt->encode($row->art_id)?>">continue</a>

Changed:

<?php echo $this->encrypt->encode($row->art_id)?>

Add 'echo' to it.

I think it will work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top