Welcome Guest, Not a member yet? Register   Sign In
Problem with URI and pass String Variables with GET...
#1

[eluser]Parker Lewis[/eluser]
Ok. This is my first post... I didn't found out a solution for my problem in google..

As u know, the uri in codeigniter handle class, function and variables in this way:

ww.myblog.com/class/function/variable1/variable2

I have to pass a string that contain blank spaces... so that i have to redirect to this page

ww.myblog.it/class/function/variable with blank spaces/variable2

but it takes only the first word ('variable').

In normal PHP programming if i had to pass a string variables (with blank spaces) with GET there was no problem..
I mean that I could write

a href="index.php?variable1=string with blank space inside"> click </a>

and it works...
i mean that
$_GET['variable1'] = string with blank space inside
and not only string

How can i manage this thing in codeigniter ? thanks in anvance...

Hope to being clear...

Federico
#2

[eluser]Italo Domingues[/eluser]
Hello. For security CodeIgniter does not allow the use of special characters and space in the url, but you can enable the query string in the configuration files located in application/config. Also read the user guide (http://ellislab.com/codeigniter/user-gui.../urls.html)

Code:
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array.  If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array']        = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']    = 'c';
$config['function_trigger']        = 'm';
$config['directory_trigger']    = 'd'; // experimental not currently in use
#3

[eluser]Parker Lewis[/eluser]
Thank you... this is a useful answer..




Theme © iAndrew 2016 - Forum software by © MyBB