Jump to content

Need Advice On Setting Cookie For Multilingual Site


stacker02
 Share

Recommended Posts

Hi,

I have been bouncing my head for the past few days trying to figure this out and finally I figured I needed to google a forum where to ask people who actually know what they are talking about.

I have a 4 language site built on a cms and I am trying to create a splash page that displays each language so you can choose which language you need. My issue is once you click the language and go back to the home domain, it defaults to English.

The code I been playing with is below. Can anyone help me figure out what I need to do so I set the cookie properly?

Thanks for any help or direction!

<?php get_header(); ?>
<script LANGUAGE="JavaScript">
<!-- hide from old browsers
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function setsplash() {
setCookie("splash", "1", "", "/");
}
//-->
</SCRIPT>

<div id="splash">
<div class="splash content">
<div class="splash enter">
<ul>
<li class="en"><a onclick="setsplash()" href="" title="English">English</a></li>
<li class="nl"><a onclick="setsplash()" href="http://b-e-m.org/nl/" title="Nederlands">Nederlands</a></li>
<li class="fr"><a onclick="setsplash()" href="http://b-e-m.org/fr/" title="Français">Français</a></li>
<li class="de"><a onclick="setsplash()" href="http://b-e-m.org/de/" title="Deutsch">Deutsch</li>
</ul>

</div>
</div>
</div>

<?php get_footer(); ?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...