Newbie, Language choise in cookie

Discussion in 'ASP General' started by TNG, Mar 6, 2005.

  1. TNG

    TNG Guest

    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.
     
    TNG, Mar 6, 2005
    #1
    1. Advertising

  2. TNG

    Evertjan. Guest

    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)
     
    Evertjan., Mar 6, 2005
    #2
    1. Advertising

  3. TNG

    Bullschmidt Guest

    Bullschmidt, Mar 7, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    5,931
    Steven Cheng[MSFT]
    Jun 3, 2004
  2. =?Utf-8?B?UGV0ZXI=?=

    List Control, multiple choise from the code

    =?Utf-8?B?UGV0ZXI=?=, Oct 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,227
    N. Demos
    Oct 13, 2004
  3. Shapper

    Cookie and Session Cookie Questions.

    Shapper, Apr 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    607
  4. Sigmathaar
    Replies:
    3
    Views:
    343
    Bob Hairgrove
    Dec 6, 2005
  5. Klaas Seelen

    retrieving the choise of a combo box

    Klaas Seelen, Apr 18, 2005, in forum: ASP General
    Replies:
    5
    Views:
    149
    Klaas Seelen
    Apr 18, 2005
Loading...

Share This Page