yup still a jr, at least for the next 6 months, than ill be a medium jr LOL...
alright, seriously, i need this thing done, so if you guys have any hints, pointers, would be appreciated.
it's probly not complicated for you guys, but i'm trying to write a language switcher.
so far it works, it change all the text on the web site for the langugage selected.
but ... it doesnt keep $_SESSION value accros pages, it look like its resetting every time you change page. thought $_SESSION was a superglobal and was keeping info for all the time connected to the site. hmm... or maybe its the form that resubmit null on page refresh and onload and $_SESSION reset. I feel like a dog chasing his own tail.
here's my code so far: (this php file is include, in the head of all the content pages, which affect the child pages, header, nav, sidebar, footer)
if(!isset($_SESSION['lang']))
$_SESSION['lang']='fr';
if(isset($_POST['test']))
$_SESSION['lang'] = $_POST['test'];
switch($_SESSION['lang'])
{
case 'en':
include('en.php');
break;
case 'fr':
include('fr.php');
break;
default:
echo 'FAILED';
break;
}
now, maybe i miss understood $_SESSION or the form is screwing with my mind or my general construction is going in the ditch.
oh yeah limitations, the client, boss, guy always have special request, dont they. he want the language switcher to be transparent, so i cant pass the variable into the URI, thats why i was using superglobals. so index.php looks like the original site, even if it's english or french, or whateva language he will make me add in the future. i cant use cookies, because most of his users have cookies deactivated.
my last idea is a noob one, but what if i keep the var in a txt file and recreate what $_SESSION is supposed to do, at least what i thought he could do. - create file, add var, change var on $_POST, destroy txt file on exit -
any comments, hints, ideas would be nice.
ill go get somemore coffee and check that form idea i had while typing this
(to check if its the form screwing around with my code)
thx guys
Dark