Welcome Guest, Not a member yet? Register   Sign In
permitted_uri_chars and $_GET
#5

[eluser]Edemilson Lima[/eluser]
Code:
http://www.mysite/controller/action/?val=1&val=2
When you try this, CodeIgniter will consider the "?val=1&val=2" as a third segment and try to pass it as a parameter to your "action" function. The best way to do this is:
Code:
http://www.mysite/controller/action/1/2
Where 1 and 2 will be the values passed to the function. Your controller could be:
Code:
class Test extendes Controller {

  function index() {
    // default function
  }

  function action($val1,$val2) {
    echo 'Value 1 = ',$val1,'<br />';
    echo 'Value 2 = ',$val2;
  }

}
So, if you call the address "http://www.mysite.com/test/action/123/456", it will display:

Value 1 = 123
Value 2 = 456

As I said before, this way is more search engine friendly, more readable and more secure.


Messages In This Thread
permitted_uri_chars and $_GET - by El Forum - 02-11-2008, 03:50 PM
permitted_uri_chars and $_GET - by El Forum - 02-11-2008, 05:45 PM
permitted_uri_chars and $_GET - by El Forum - 02-11-2008, 07:02 PM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 03:12 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 06:12 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 06:25 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 06:49 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 07:04 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 07:26 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 07:37 AM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 04:20 PM
permitted_uri_chars and $_GET - by El Forum - 02-12-2008, 05:41 PM
permitted_uri_chars and $_GET - by El Forum - 02-19-2008, 12:56 AM
permitted_uri_chars and $_GET - by El Forum - 02-19-2008, 07:27 AM
permitted_uri_chars and $_GET - by El Forum - 02-19-2008, 10:40 AM
permitted_uri_chars and $_GET - by El Forum - 02-19-2008, 11:22 AM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:01 AM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 10:28 AM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:18 PM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:23 PM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:29 PM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:38 PM
permitted_uri_chars and $_GET - by El Forum - 02-20-2008, 08:47 PM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 07:41 AM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 08:33 AM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 11:32 AM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 11:59 AM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 12:16 PM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 01:28 PM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 01:49 PM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 03:07 PM
permitted_uri_chars and $_GET - by El Forum - 02-21-2008, 03:14 PM
permitted_uri_chars and $_GET - by El Forum - 09-02-2008, 06:12 PM
permitted_uri_chars and $_GET - by El Forum - 09-02-2008, 07:55 PM
permitted_uri_chars and $_GET - by El Forum - 09-02-2008, 09:29 PM
permitted_uri_chars and $_GET - by El Forum - 09-02-2008, 10:29 PM
permitted_uri_chars and $_GET - by El Forum - 09-03-2008, 12:29 AM
permitted_uri_chars and $_GET - by El Forum - 09-03-2008, 02:16 AM
permitted_uri_chars and $_GET - by El Forum - 09-03-2008, 02:47 AM
permitted_uri_chars and $_GET - by El Forum - 09-03-2008, 11:00 AM
permitted_uri_chars and $_GET - by El Forum - 04-20-2009, 11:46 PM
permitted_uri_chars and $_GET - by El Forum - 04-21-2009, 12:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB