Results 1 to 6 of 6

Thread: where's the mistake? (cookies)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18

    Unhappy

    i made a page with a form where you enter a value. This is used to pass as a querystring the fontsize for the next page, and to set the font size as a cookie for another page. Where's the mistake with the cookie? (the querystring works perfectly)

    the page that post the value
    --------
    <form name="form1" method="post" action="cookies.asp">
    <input type="text" name="carattere" size="3" maxlength="1">
    <input type="submit" name="Submit" value="Invia">
    </form>
    --------
    the page that receive the value and use the querystring (works)
    --------
    <%
    dim idim
    idim=request("carattere")
    strdim = idim
    Response.Cookies("prova")("dimtesto")= idim
    Response.cookies("prova").Expires = date + 365%>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF"><font size="<%=strdim%>">
    Ciao Stronzone, questo coso dovrebbe variare ogni volta. Adesso vai alla prossima pagina
    <a href="cookies2.asp">prova</a> </font>

    </body>
    </html>
    --------
    the page that use the cookie
    --------
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF"><font size="<%request.cookies("prova")("dimtesto")%>">
    Adesso c'è questa pag. qua</font>
    </body>
    </html>
    ------
    the output is simply font size="".... as if my cookie as never been sent!
    P.S. Can i manage cookie with the pws or should i upload to a server on the web?

    PLZ help!!

  2. #2
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118

    Arrow

    Have you declared strdim in
    the page that receive the value and use the querystring (works) ??

    if not declare it as dim and try....

    Sonia

  3. #3
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118
    idim=request("carattere") ???
    is this should be

    idim=request.item("carattere")
    OR
    idim=request.querystring("carattere")

    Sonia

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18
    strdim is used directly on the page and it works.
    idim is used to assign a value to a cookie and it doesn't work
    why?are cookies like ssi?
    It's allowed to assign a variable to a cookie, isn't it?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18
    i forgot.
    i used request("carattere") not request.form("carattere") because there are no querystring objects so the request can only be a form.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18
    anyone knows?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width