form redirection |
hi guys,
Hope you are all fine. starting with CI, i have a quick question. in my controllers, i have contact.php with this code: PHP Code: $this->email->from($sender_name,$from); my problem is the last line. i have a site in spanigh and english, how can i make rediction to spanish after submit ? when we are in spanish and vice-versa? thanks for your help
Well how does your user switch languages normally? If it's just by visiting some endpoint, redirect him to that endpoint (e.g. redirect('home/spanish')
![]() (04-18-2015, 09:08 AM)gadelat Wrote: Well how does your user switch languages normally? If it's just by visiting some endpoint, redirect him to that endpoint (e.g. redirect('home/spanish') The thing is if i do i like this, now the problem come from the other side if you are in englih part of site and fill form you will be redirect to spanish ... and yes my users switch languages normally thanks
The thing is if i do i like this, now the problem come from the other side
if you are in englih part of site and fill form you will be redirect to spanish ... and yes my users switch languages normally thanks
You need to determine what language the user is currently using. This is determined by whatever method you used to set the language in the first place. If it's just set by a route in your application, you need to check the relevant portion of the URI. If it's set in the config or the session, you need to retrieve it from there.
Once you know which language the user is currently using, you just send them to the appropriate page. |
Welcome Guest, Not a member yet? Register Sign In |