2011-07-26 43 views

回答

0

您不需要首先通過$this->uri->segment('{n}')獲取GET請求的所有部分嗎?

我可能是錯的,但我不認爲你這樣做的方式是正確的。如果我要編碼,我會做以下事情:

function index() 
{ 
    $barcode = $this->uri->segment('3'); 
    $text = $this->uri->segment('4'); 
    $format = $this->uri->segment('5'); 
    $quality = $this->uri->segment('6'); 
    $width = $this->uri->segment('7'); 
    $height = $this->uri->segment('8'); 
    $type = $this->uri->segment('9'); 

    // continue with your code 
} 
+0

他這樣做的方式很好。請參閱CI的['uri_to_assoc()'](http://codeigniter.com/user_guide/libraries/uri.html)和PHP的['func_get_args()'](http://php.net/manual/en/function .FUNC-GET-args.php)。這是一個編碼斜線的問題,對我來說,我得到一個*服務器* 404(不是一個CI)。我不知道爲什麼,用'.htaccess'做些什麼? –