mehmet: per cookie (radiobutton) seitenauswahl

Beitrag lesen

hallo forum,
endlich bin ich fündig geworden
also, es hat sich erledigt
falls es jemand nutzen möchte

<!-- gefunden: http://www.webdeveloper.com/forum/archive/index.php/t-7737.html -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>ABLE International - choose your language</title>
<script language="Javascript" type="text/javascript">
<!--
function ReadCookie() {
var NameOfCookie="Language";
if(document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if(begin != -1)
{
// our cookie was set.
// The value stored in the cookie is returned from the function
begin += NameOfCookie.length + 1;
end = document.cookie.indexOf(";",begin);
if(end == -1) end = document.cookie.length;
language=(document.cookie.substring(begin,end));
if (language=="FR")document.location.href='hallo1.htm';
if (language=="GB")document.location.href='hallo2.htm'
if (language=="ES")document.location.href='hallo3.htm'
if (language=="PT")document.location.href='hallo4.htm'
}
}
}
function SetCookie(cookieName,cookieValue) {
var today = new Date();
var expire = new Date();
var nDays=365
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)

  • ";expires="+expire.toGMTString();
    }
    //-->
    </script>
    </HEAD>

<BODY onload="ReadCookie()">

<form>
Please select your language<br>
(If you have cookies disabled in your browser, it will not work)<br>
<input type=radio name="language" onClick="SetCookie('Language','FR');document.location.href='hallo1.htm';">FR
<input type=radio name="language" onClick="SetCookie('Language','GB');document.location.href='hallo2.htm';">GB
<input type=radio name="language" onClick="SetCookie('Language','ES');document.location.href='hallo3.htm';">ES
<input type=radio name="language" onClick="SetCookie('Language','PT');document.location.href='hallo4.htm';">PT
</form>
</center>
<br>
If you do not wish to place a 'Cookie' in your computer, click in the link below.
<BR>

</body>
</html>

gruss
mehmet