Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Matching two variables question
08-17-2004, 11:25 PM #1
- Join Date
- Apr 2004
- Thanked 0 Times in 0 Posts
Matching two variables question
Ok so I have the following:
<% IF RS("appealID") = request.querystring("appealID") THEN Response.Write "TRUE" END IF%>
I know for a fact that RS("appealID") is the same as the querystring but nothing is getting printed however when I type in the query string staticly like so:
<% IF RS("appealID") = "160" THEN Response.Write "TRUE" END IF%>
I know that both variables are being carried but I don't know why this will not work.
Any help will be greatly appreciated.
08-18-2004, 11:56 PM #2
- Join Date
- Jun 2002
- Ontario, Canada Remaining Brain Cells: 6
- Thanked 1 Time in 1 Post
You need the Int() function to make sure the value you type into the query is really an integer.
Right now it's a string; Let's say RS("appealID") = "apple" and request.querystring("appealID") = "apple", (page.asp?appealID=apple) this would equal True.
Be warned when using Query Strings to get ID numbers, if a user changes them they can act as a way to gey permission to do this they should not, or to change results in a database they should not.Code:<% If RS("appealID") = int(Request.QueryString("appealID")) Then Response.Write "TRUE" End If%>