Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Newbie, Language choise in cookie

Reply
Thread Tools

Newbie, Language choise in cookie

 
 
TNG
Guest
Posts: n/a
 
      03-06-2005
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.


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      03-06-2005
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?")%>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
 
 
 
Bullschmidt
Guest
Posts: n/a
 
      03-07-2005
And here's a good cookie resource:

ASP Cookies
http://www.w3schools.com/asp/asp_cookies.asp

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
your best choise richardelisha@gmail.com Computer Support 1 01-07-2008 07:44 AM
your best choise richardelisha@gmail.com Digital Photography 1 01-07-2008 05:00 AM
best choise between RIP and OSPF Mario Calvi Cisco 4 04-23-2007 08:32 PM
Need advice to choise complex data structure (STL) Sigmathaar C++ 3 12-06-2005 03:56 PM
List Control, multiple choise from the code =?Utf-8?B?UGV0ZXI=?= ASP .Net 2 10-13-2004 08:43 AM



Advertisments