1

I want to get query string variable value and allowed on config file for query string rule.

My Url :

http://localhost/Demo/admin_login/?mts=ok

I did in config file :

 $config['allow_get_array'] = TRUE;
 $config['enable_query_strings'] = TRUE;
 $config['uri_protocol'] = 'PATH_INFO';

In controller, I echo this

echo $_GET['mts'];

I got this error :

Message:  Undefined index: mts
Manish Tiwari
  • 1,806
  • 10
  • 42
  • 65
  • You use standard codeigniter format as `http://localhost/Demo/admin_login/ok` and get value and get value `echo $mts =$this->uri->segment(3);` – Yash Feb 25 '16 at 08:52
  • In your code you missed action `index`. Try to use `http://localhost/Demo/admin_login/index?mts=ok` – Yash Feb 25 '16 at 08:53
  • Reference: http://stackoverflow.com/a/2898004/3635079 – dhruv jadia Feb 25 '16 at 09:08

1 Answers1

0

Change your .htaccess to remove the ? (if present) in the rewrite rule

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

try How to make CodeIgniter accept "query string" URLs?

Community
  • 1
  • 1
safin chacko
  • 1,345
  • 1
  • 11
  • 18