0

I am trying to get the parameter I passed in my URL using the GET but I have an error:

An Error Was Encountered

The URI you submitted has disallowed characters.

My URL is looks like this:

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

And in my controller:

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

How can I fix this?

4
  • so you need 1 by get ? my question how and when you need it Commented Feb 26, 2016 at 1:24
  • 1
    Try http://localhost/teradasys/index.php/users/user/user_info?user_id=1. Commented Feb 26, 2016 at 1:28
  • Thanks. I forgot to include the ? before the parameter. Sorry for my simple mistake. Commented Feb 26, 2016 at 1:31
  • You can accept @ShamarKellman 's answer bellow since it points same solution. Commented Feb 26, 2016 at 1:40

2 Answers 2

3

You URL is missing the ? which defines the start of a query parameter. Therefore your URL should look like this http://localhost/teradasys/index.php/users/user/user_info?user_id=1. Then you can use the get() function.

Sign up to request clarification or add additional context in comments.

Comments

0

Use Segment !!

'&' disallowed characters.

https://ellislab.com/codeigniter/user-guide/libraries/uri.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.