jac,

Like bj mentioned, remove the quotes from around Date + 14.

Also, I had to declare the variable "i" in the current.asp page to get it to
run because of the "OPTION EXPLICIT" declaration.

I'm using MS Interdev in a debug mode to check the pages (with IIS 5.0).

regards
Bob

-----Original Message-----
From: jac [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 11, 2003 10:13 AM
Subject: RE: Cookies, Form & Setting Preferences


Hi Bob,
thanks for that but I still can't get it to work :o(
I'm testing it at http://www.ingentus.com/Alan/Preferences.asp
Can't figure out what am I doing wrong? Would you mind having another look &
see if your can spot my mistake please? I've pasted the amended code below.

TIA
jac.

------------------------------
Preferences.asp
------------------------------
<% Option Explicit %>

<%
If Request.Form("PreferencesSet")="True" Then
Response.Cookies("Preferences")("Colour")=Request.Form("Colour")
Response.Cookies("Preferences")("Topic")=Request.Form("Topic")
Response.Cookies("Preferences").Expires="Date + 14"
Response.Write"<HTML><BODY>Preferences Set.<a href='Content.asp'>View
Page</a></BODY></HTML>"
Else
%>


<html>
<body>
<Form method="POST" action="Preferences.asp">

<p> What topic are you interested in?</p>
<p>ASP <input type="radio" name="Topic" value="ASP" checked></p>
<p>JSP <input type="radio" name="Topic" value="JSP"></p>

<p> What colour scheme do you prefer?</p>
<p> Black on White <input type="radio" name="Colour" value="BW"></p>
<p> Yellow on Black <input type="radio" name="Colour" value="YB"
checked></p>

<p><input type="hidden" name="PreferencesSet value="True"></p>

<p><input type="submit" value="Record Preferences"></p>

</Form>
</body>
</html>
<%End If%>

----------------------------
Content.asp
----------------------------
<% Option Explicit %>

<html>
<%
Dim ASP(5)
Dim JSP(5)

ASP(0)="ASP link 1"
ASP(1)="ASP_URL_1"
ASP(2)="ASP link 2"
ASP(3)="ASP_URL_2"
ASP(4)="ASP link 3"
ASP(5)="ASP_URL_3"

JSP(0)="JSP link 1"
JSP(1)="JSP_URL_1"
JSP(2)="JSP link 2"
JSP(3)="JSP_URL_2"
JSP(4)="JSP link 3"
JSP(5)="JSP_URL_3"

If Request.Cookies("Preferences")<>"" Then

If Request.Cookies("Preferences")("Colour")="BW" Then
Response.Write "<body bgcolor='white' text='black' link='black'
vlink='black'>"
End If

If Request.Cookies("Preferences")("Colour")="YB" Then
Response.Write "<body bgcolor='black' text='yellow' link='yellow'
vlink='yellow'>"
End If

'ASP link code
If Request.Cookies("Preferences")("Topic")="ASP" Then
Response.Write "<ul>"
i=0
Do While i<5
Response.Write"<li><a href='" & ASP(i+1)& "'>" & ASP(i) & "</a></li>"
i=i+2
Loop
Response.Write "<ul>"
End If

'JSP link code
If Request.Cookies("Preferences")("Topic")="JSP" Then
Response.Write "<ul>"
i=0
Do While i<5
Response.Write"<li><a href='" & JSP(i+1)& "'>" & JSP(i) & "</a></li>"

i=i+2
Loop
Response.Write "<ul>"
End If

Else
%>

<!--Next section is showing a link for the user to go back to
preferences.asp to set their prefs
 -->
<body>
<p><a href="Preferences.asp">Set Your Preferences.</a></p>
</body>

</html>
<% End If%>



> Jac,
>
> Apart from a mispelled Repsonse.Cookies(...
>
> This was the killer.
>
> Was:
> Response.Write"<li><a href='"& ASP(i+1)&"'>& ASP(i)&""</a></li>"
>                                            ^         ^
> Changed to:
> Response.Write"<li><a href='" & ASP(i+1)& "'>" & ASP(i) & "</a></li>"
>                                              ^            ^
> Regards
> Bob
>


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to