PDA

Click to See Complete Forum and Search --> : where's the mistake? (cookies)


Maranza
Mar 29th, 2001, 12:18 PM
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!!

harsoni
Mar 29th, 2001, 02:26 PM
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

harsoni
Mar 29th, 2001, 02:29 PM
idim=request("carattere") ???
is this should be

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

Sonia

Maranza
Mar 30th, 2001, 06:41 AM
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?

Maranza
Mar 30th, 2001, 06:44 AM
i forgot.
i used request("carattere") not request.form("carattere") because there are no querystring objects so the request can only be a form.

Maranza
Mar 30th, 2001, 01:43 PM
anyone knows?