Md.Shams Imran Shuvo
Md.Shams Imran Shuvo

Reputation: 96

Generate encrypted Code in Codeigniter without "/" using encrypt Library or Encryption Library

When i use encrypt library or encryption library in codeigniter then it generates encryption key. But sometimes it contains "/". it is problematic in getting data from url. Need to generate key without "/".

www.example.com/controller/function/key(sdfsdf/3423sdf/sdff+fd-234) replace By www.example.com/controller/function/key(sdfsdf3423sdfsdff+fd-234)

Upvotes: 1

Views: 141

Answers (2)

Masud_ma
Masud_ma

Reputation: 104

**First Load encrypt library**
 $this->load->libery('encrypt');
 **Then set Config**
 $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\'+,-=';
 <a href="<?php base_url('controller/function/'.$this->encrypt->encode($value));?>">
I hope work your encrypted url..

Upvotes: 1

EyuelDK
EyuelDK

Reputation: 3189

Simple workaround:

public function my_function() {

  $args = func_get_args();
  $key = implode('/', $args);
  // TODO
}

Upvotes: 1

Related Questions