Forum Statistics

  • Forum Members: 4,245
  • Total Threads: 3,572
  • Total Posts: 2
There are 1 users currently browsing forums.

Partner Sites

Reply
Old 04-30-2009, 11:15 PM   #1 (permalink)
 
Status: Account Temporarily Suspended
Join Date: Mar 2009
Posts: 52

Rep Power: 0 kuma.lk is on a distinguished road



Default Language selection

Hi
Im working on some language selection in a website, so far it is working wery well exept i cant get it to remember the chosen language when changing pages, im thinking it must be done by either using a session or a cookie but im stuck atm.

Here is my code.
PHP Code:
<?php
//language
$languages = array(
'en' => 'english',
'dk' => 'danish',
);

if (isset($_GET['lang']) AND array_key_exists($_GET['lang'], $languages))
{
include './lang/' . $languages[$_GET['lang']] . '.php';
}
else
{
include './lang/english.php';
}

?>
And to change the language im just using simple links
PHP Code:
<a class="link" href="<? echo $_SERVER[PHP_SELF];?>?lang=dk"><?php echo $lng['danish']; ?></a>

<a class="link" href="<? echo $_SERVER[PHP_SELF];?>?lang=en"><?php echo $lng['danish']; ?></a>
Any ideas ??
__________________________________________________ ________________
fettabsaugung
Stack and Tilt
kuma.lk is offline Add Infraction for kuma.lk   Reply With Quote
Old 05-14-2009, 02:12 AM   #2 (permalink)
 
Status: Newbie
Join Date: Apr 2009
Location: UK
Posts: 21

Rep Power: 14 kateloe is on a distinguished road



Default

Let me check it on my PC then i will be back with the problem area
__________________
seo uk
kateloe is offline Add Infraction for kateloe   Reply With Quote


Reply

Bookmarks

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.5.0 RC2