• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing letters in search function (url and function)

Hello I have the following problem, my site is non-english language based.
I have search function in my controller which is like
public function search($keyword, $offset, ...){}

When people type search query to searchbox on my site, it turns them into mysite.com/search/query.

Thing that bothers me is, that there are non-english characters in my keywords. I have another function, which converts them to english chars, but I want this new string also appears in my URL - it will be more seo-friendly.

So, when people type search queries into my searchbox, they are typing in non-english, it goes into URL in no-english, so is: mysite.com/search/non-english. It's wrong, i want it to be mysite.com/search/converted, but it must search for exact query typed in box (non-english).

Any ideas? Smile

In the controller that processes the POST request:

1) Validate the orignal search query. Once it is valid...
2) Add it to session userdata.
3) Figure out what the English version is.
4) Forward the user to mysite.com/search/englishversion
5) On the results page, check if the session variable exists. if it does, search by that. If not, search by what's in the URL (make sure to sanitize it).

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.