Controller reading Chinese as parameters Error 400 - 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: Controller reading Chinese as parameters Error 400 (/showthread.php?tid=60902) |
Controller reading Chinese as parameters Error 400 - El Forum - 07-27-2014 [eluser]Unknown[/eluser] So I have a controller that reads in a parameter to determine which page to display. the controller uses a model to retrieve information from the database (articles). <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Articles extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('ArtModel'); } public function index($artTitle){ $data['query'] = $this->ArtModel->get_article(urldecode($artTitle)); $this->load->view('inc/header',$data); $this->load->view('articles',$data); $this->load->view('inc/footer'); } } the Decode URL is there so that the correct information gets sent to the database. And all this works locally. however when I uploaded it to my website, I kept getting a 400, but if the input parameter ($artTitle) are english characters, the pages displays normally. can anyone tell me why this doesnt work with Chinese characters? |