Newbie, Language choise in cookie

T

TNG

Hi

I'm using this form to send a language choice to my index2 file.
But I like also to save the users choice to a cookie, so I can use the
language settings
in all my other files.

How can I do this ?

<form name="Lang_choise" action="index2.asp" method="get">
<input type="hidden" name="item" value="start">
<input type="hidden" name="subitem" value="x">
<select name="lang">
<option value="Fr"> Français</option>
<option value="Nl" selected> Nederlands</option>
</select>
<br><br>
<center>
<input type="submit" value="Start">
</center>
</form>

Thx in advance.
 
E

Evertjan.

TNG wrote on 06 mrt 2005 in microsoft.public.inetserver.asp.general:
Hi

I'm using this form to send a language choice to my index2 file.
But I like also to save the users choice to a cookie, so I can use the
language settings
in all my other files.

How can I do this ?

<form name="Lang_choise" action="index2.asp" method="get">
<input type="hidden" name="item" value="start">
<input type="hidden" name="subitem" value="x">
<select name="lang">
<option value="Fr"> Français</option>
<option value="Nl" selected> Nederlands</option>
</select>
<br><br>
<center>
<input type="submit" value="Start">
</center>
</form>

[Please do not put irrelevant parts, like <center> in an example]

If it is only for the duration of the session,
put the choice in a session variable.
We are talking about asp, I hope?

my preferred method is post, btw.

index.asp:

<form name="Lang_choise" action="index2.asp" method="post">
<select name="lang">
<option value="Fr"> Français</option>
<option value="Nl" selected> Nederlands</option>
<option value="En"> English</option>
</select>
<br>
<input type="submit" value="Start">
</form>

========================

index2.asp:

<%
session("Lang_choise")=request.form("Lang_choise")
%>
blahbla

============================

And on most other asp pages, something like this:

<%
function s(Tfr,Tnl,Ten)
if session("Lang_choise")="Fr" then
s = Tfr
elseif session("Lang_choise")="En" then
s = Ten
else ' "Nl" dus,
s = Tnl
end if
end function
%>
<html>...

<% =s("Bonjour","Goede morgen","Hi there")%> TNG,<br>
<% =s("Voici mon example","Dit is mijn voorbeeld","Whatsay?")%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top