Forums
This topic is locked
comparing cookie value and database value
Posted 08 Jan 2003 22:48:41
1
has voted
08 Jan 2003 22:48:41 Matthijs Horsman posted:
Hello all,Ok, i think i am losing it... Here's my problem;
I wanna compare a value (user id so it's a number) with a value out of the database (also the user id) using ASP/VB and ACCESS on WINXP
my code is:
<% if request.Cookies("FreesUID"



Look's pretty normal i should say... but, i don;t get any "yes" in my screen... <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>
When i just use <% = request.Cookies("FreesUID"


Do i need a Ctrs or Len or something like that to make it work??
TIA
Matthijs
Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB/MS-SQL
Replies
Replied 09 Jan 2003 01:18:36
09 Jan 2003 01:18:36 paul durbar replied:
Try formatting it as a proper if else end if statement. Your syntax looks alright though. Try:
<%
dim usercookie
usercookie = Request.Cookies("FreesUID"
dim useridval
useridval = rsTopics.Fields.Item("USER_ID"
.Value
If usercookie <> useridval Then
Response.Write("NO"
Else
Response.Write("Yes"
End if
%>
<%
dim usercookie
usercookie = Request.Cookies("FreesUID"

dim useridval
useridval = rsTopics.Fields.Item("USER_ID"

If usercookie <> useridval Then
Response.Write("NO"

Else
Response.Write("Yes"

End if
%>
Replied 09 Jan 2003 10:26:50
09 Jan 2003 10:26:50 Matthijs Horsman replied:
I don't know why but Cstr worked...
thnx for help
Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB/MS-SQL
thnx for help
Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB/MS-SQL