I'm not sure why this is not working. I have allow_get_array = TRUE in the config file. Here's what I am trying to do..
This is the link that the user will click from their email
http://www.site.com/confirm?code=f8c53b1578f7c05471d087f18b343af0c3a638
confirm.php Controller:
$code = $this->input->get('code');
also tried
$code = $this->input->get('code', TRUE);
Any ideas?
In your config.php
change the following:
$config['uri_protocol'] = 'AUTO';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['enable_query_strings'] = FALSE;
To:
$config['uri_protocol'] = 'REQUEST_URI';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?';
$config['enable_query_strings'] = TRUE;
Instead of messing with Query Strings you could change your URI to use segments like http://www.site.com/confirm/code/f8c53b1578f7c05471d087f18b343af0c3a638
. To access the code segment you would use $this->uri->segment(3);
. Personally I prefer this way as to using Query Strings. See URI Class
Use this:
$code = isset($_REQUEST['code']) ? $_REQUEST['code'] : NULL;
EDIT:
In PHP >=7.0, you can do this:
$code = $_REQUEST['code'] ?? NULL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With