![]() |
codeigniter routing problem with http POST - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: codeigniter routing problem with http POST (/showthread.php?tid=52312) |
codeigniter routing problem with http POST - El Forum - 06-05-2012 [eluser]Unknown[/eluser] In my MY_Controller.php I have public function _remap($method, $args) { $postfix = @$_SERVER['REQUEST_METHOD'] ? $_SERVER['REQUEST_METHOD'] : 'GET'; if ( ! method_exists($this,"{$method}_{$postfix}")) { show_404(); } call_user_func_array(array($this, "{$method}_{$postfix}"), $args); } In my config/routes.php, I have $route['apps/upload'] = 'apps/app_upload/upload'; In my CI controller `apps/app_upload.php`, I have a `upload_POST` function and `upload_GET` function. sending HTTP GET request to `/apps/upload` works fine. however, sending HTTP POST request to `/apps/upload` doesn't hit the `_remap` function at all, hence never reach the upload_POST function. what could be the problem here? codeigniter routing problem with http POST - El Forum - 06-06-2012 [eluser]Unknown[/eluser] oops, the above code works perfectly and the fault is at my testing script. ;/ |