2016-02-26 21 views
0

我試圖讓我在我的網址使用GET傳遞的參數中的URL獲得參數,但我有一個錯誤:不能使用笨3

An Error Was Encountered 

The URI you submitted has disallowed characters. 

我的網址是這樣的:

http://localhost/teradasys/index.php/users/user/user_info&user_id=1 

而且在我的控制器:

public function user_info() { 
    $user_id = $this->input->get('user_id'); 
    print_r($user_id); 
} 

我該如何解決這個問題?

+0

因此您需要通過get?1?我的問題如何以及何時需要它 –

+1

嘗試'http://localhost/teradasys/index.php/users/user/user_info?user_id = 1'。 – Tpojka

+0

謝謝。我忘記在參數前加上'?'。對不起,我的簡單錯誤。 – Jerielle

回答

3

您的網址缺少定義查詢參數開始的?。因此,您的網址應如下所示:http://localhost/teradasys/index.php/users/user/user_info?user_id=1。然後你可以使用get()函數。

+1

這不是答案 –