...

View Full Version : Matching two variables question



furious
08-17-2004, 10:25 PM
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%>

It works.

I know that both variables are being carried but I don't know why this will not work.

Any help will be greatly appreciated.

Morgoth
08-18-2004, 10:56 PM
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.


<% If RS("appealID") = int(Request.QueryString("appealID")) Then Response.Write "TRUE" End If%>


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.

Enjoy!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum