Welcome Guest, Not a member yet? Register   Sign In
Permitting UTF-8 alphabetical chars
#1

[eluser]cb951303[/eluser]
well, my site does a database search with the keyword taken from the URI but according to this:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

I can't include chars like 'ç', 'ş', 'ğ', 'ı' or any other non ascii utf-8 chars in the URI.
is there a solution to this?

or am I just not supposed to use URI to pass search keywords ?

thanks very much
#2

[eluser]Crimp[/eluser]
You can use rawurlencode or base 64 encoding. Obviously, use the decode functions to perform the search.
#3

[eluser]cb951303[/eluser]
great idea thanks
#4

[eluser]cb951303[/eluser]
I tried rawurlencode and urlcode but they don't seem to work. The string remains untouched. but it only happens with CI. does CI overrides some core php functions or something?
#5

[eluser]maesk[/eluser]
You could try

Code:
$this->encrypt->encode($your_query);

Read this article by Derek Allard:
http://www.derekallard.com/blog/post/pas...e-igniter/

I had the same problem and I tried Derek's approach and also base64 encoding and rawurlencode but it didn't work properly. Some characters like '+' or '-' made problems or when the encrypted string contains a '/' (forward slash) CI thinks the URI segment ends there. I ended up passing the query by POST instead of in the URL. For this I had to adapt the pagination class, but it works well now.
#6

[eluser]cb951303[/eluser]
[quote author="maesk" date="1220984620"]You could try

Code:
$this->encrypt->encode($your_query);
[/quote]
this won't work since the encoded string still *may* contain disallowed chars.

Quote:Read this article by Derek Allard:
http://www.derekallard.com/blog/post/pas...e-igniter/

I had the same problem and I tried Derek's approach and also base64 encoding and rawurlencode but it didn't work properly. Some characters like '+' or '-' made problems or when the encrypted string contains a '/' (forward slash) CI thinks the URI segment ends there. I ended up passing the query by POST instead of in the URL. For this I had to adapt the pagination class, but it works well now.

Thanks for the link, I'll look at it. My problem is that I use both GET and POST for my search string. Here is the thing, I have a database. Results are returned in a table. The table has a header section with the field names. When the user clicks the field names, it sorts the current search according to that field name ASC or DESC. Thus for the header links I have to use GET. Does anyone have a better idea?

Here is a screenshot:[Image: http://img159.imageshack.us/img159/3415/...tg6.th.jpg]
#7

[eluser]Azghanvi[/eluser]
Any one found any solution for paginiation with search string in url ?
Please share your findings.

CI team ?? any solution ??
#8

[eluser]Azghanvi[/eluser]
Any one found solution for pagination with search string?
Please share your findings.

CI Team ... please help!

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB