my view:
<form action="<?=base_url()?>index.php/frontend/main_con/temp">
<input type="text" name="temp">
<input type="submit"/>
</form>
Controller:
function temp(){
echo $_GET['temp'];
}
i cant able to reach this function and i got an error
An Error Was Encountered The URI you submitted has disallowed characters.
So, how to pass form data in controller using GET method? thanx in advance.
View:
<form action="<?=site_url('controller_name/function_name);?>" method="get">
<input type="text" name="temp">
<input type="submit"/>
</form>
Controller
class controller_name extends CI_Controller{
function function_name(){
echo $this->input->get('temp');
}
}
parse_str($_SERVER['QUERY_STRING'],$_GET);
ONLY worked for me after I added the following line to applications/config/config.php:
$config['uri_protocol'] = "PATH_INFO";
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