Welcome Guest, Not a member yet? Register   Sign In
weird characters in the url
#8

[eluser]dianikol85[/eluser]
i got your point osci.

i may confuse you with my previews posts.

I will explain my technique for search form and pagination. I'll keep it short

i have a controller and a method index in it. In the index i fetch a db table and pass it to a view with pagination also

Code:
class Welcome extends CI_Controller {
    
   function index($search_terms = '')
   {

        //  retrieve data
        //  configure the pagination
        //  load the view
   }
}

In the view i have also a search form that when i submit it , it goes to a pre-search method tha produces the query string, When the query is ready i redirect to the index and pass to it the query string . Please notice in the code above i have
Code:
function index($search_terms = '')

The var $search_terms i pass it to the model where i can have $this->db->like('name',$search_terms);

Code:
function pre_search()
   {
        
        //  retrieve submited data from $_POST
        //  generate the query string in this format: $keyword = search_by_name=Doe+John
        //  and pass it to the view
        redirect('index/'.$keyword);
   }


The procedure above has as a result to produce a url like that
Code:
http://test.loc/welcome/index/search_by_name=Doe+John

and that's how i accomplish search results with pagination.

The problem is when i search with a greek keyword
Code:
search_by_name=τεστ

the $search_terms var contains hex value like that

Code:
search_by_name = CF84CEB5CF83CF84

so the sql query fails to return any value.


I hope you understand what i wrote , my english aren't so good.

Do you suggest a different method to achive search results with pagination?


Messages In This Thread
weird characters in the url - by El Forum - 04-10-2011, 04:35 AM
weird characters in the url - by El Forum - 04-10-2011, 05:04 AM
weird characters in the url - by El Forum - 04-10-2011, 05:05 AM
weird characters in the url - by El Forum - 04-10-2011, 06:23 AM
weird characters in the url - by El Forum - 04-10-2011, 06:35 AM
weird characters in the url - by El Forum - 04-10-2011, 06:52 AM
weird characters in the url - by El Forum - 04-10-2011, 07:43 AM
weird characters in the url - by El Forum - 04-10-2011, 08:20 AM
weird characters in the url - by El Forum - 04-10-2011, 09:01 AM
weird characters in the url - by El Forum - 04-10-2011, 09:14 AM
weird characters in the url - by El Forum - 04-10-2011, 09:25 AM
weird characters in the url - by El Forum - 04-10-2011, 09:30 AM
weird characters in the url - by El Forum - 04-10-2011, 09:33 AM
weird characters in the url - by El Forum - 04-10-2011, 09:38 AM
weird characters in the url - by El Forum - 04-10-2011, 09:52 AM
weird characters in the url - by El Forum - 04-10-2011, 10:00 AM
weird characters in the url - by El Forum - 04-10-2011, 10:12 AM
weird characters in the url - by El Forum - 04-10-2011, 10:20 AM
weird characters in the url - by El Forum - 04-10-2011, 10:26 AM
weird characters in the url - by El Forum - 04-10-2011, 10:45 AM
weird characters in the url - by El Forum - 04-10-2011, 11:17 AM
weird characters in the url - by El Forum - 04-10-2011, 12:17 PM
weird characters in the url - by El Forum - 04-10-2011, 12:42 PM
weird characters in the url - by El Forum - 04-11-2011, 02:49 AM
weird characters in the url - by El Forum - 04-11-2011, 03:56 AM
weird characters in the url - by El Forum - 04-11-2011, 04:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB