Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Duplicate Quertstrings 1

Status
Not open for further replies.

MarkZK

Technical User
Jul 13, 2006
202
GB
Hi all,

Could somebody tell me how to prevent duplicate query strings being entered into an url.

for example: I want to allow /file.asp?t=4,5,2

but response end if more than one "t" querystrings are entered( /file.asp?t=4,5,2&t=3,2,1 ),

any ideas ?

Thanks.
 
Just check to see if more t's occur like so...


intPositionOfFirstT = instr(str,"t")
intDoesSecondExist = instr(intPositionOfFirstT,str,"t")

If intDoesSecondExist = 0 then
'# only 1 in string
End if

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
Hi, sorry, I forgot about this thread.

Thanks for the code Snowboardr, I went with a similar idea to that, only using the following code.

Code:
for i=1 to Request.QueryString("t").Count 
if Request.QueryString("t").Count > 1 then
response.end
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top