form redirection - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: form redirection (/showthread.php?tid=61477) |
form redirection - yves - 04-18-2015 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 RE: form redirection - gadelat - 04-18-2015 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'). RE: form redirection - yves - 04-18-2015 (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 RE: form redirection - yves - 04-18-2015 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 RE: form redirection - mwhitney - 04-20-2015 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. |