WordPress.org

Ready to get started?Download WordPress

Forums

Help with setting Cookies (2 posts)

  1. ntarantino
    Member
    Posted 3 years ago #

    I am trying to create a splash page (I know not the best, but my friend wants it) where you can pick which language to visit the site.

    English
    Dutch
    French
    German

    I would like when they click a language that when they go off the site when they come back it remembers which language they pick.

    I have tried a plugin that has helped a bit to get started, but I am not sure how to set a cookie for each language. Here is where I am at:

    <?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(); ?>

    Any help with my lack of php :)

  2. usamatariq
    Member
    Posted 2 years ago #

    i am a guy who surfs internet to gain knowledge
    Download gta iv

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.