I have an issue in my code that I can not figure out. Locally it works but when I place it live on the server it doesn't. I must be doing something wrong between both versions of PHP.
After debugging my code on the live version, looks like the switch that defines my languages, is all ways setting the default. This is what I am doing.
1) I dropped a COOKIE, after selecting a Language ( debugged and works ).
2) I have a switch, that checks if that COOKIE is (fr) French or (en) English.
switch ($_COOKIE['displaylang'])
{
case 'fr' :
define('LANG_CODES', 'french.lang');
define('LANG_FILES', 'fr');
break;
case 'en' :
default :
define('LANG_CODES', 'english.lang');
define('LANG_FILES', 'en');
break;
}
3) Include the language codes based on the defined LANG_CODES, and include it.
include (file_exists(LANG_CODES) ? LANG_CODES : 'english.lang'); ( debugged and works ).
That is it in a nut shell, the problem is that it will always include english.lang and not the french.lang when the COOKIE set is fr.
Something I am doing wrong, in my switch?
Thanks