0

I have problem with external links, where users add additional characters to the end of a variable. The links should be something like "page.asp?ID=261", however I see many external links to the page with malformed additional characters, like "page.asp?ID=261FTR223". These are mostly from social networking sites.

I need to clean this up as it rresults in page errors and the variable contains both numeric and alpha, where it should only be numeric. I also only want the first set of numeric values and the rest of the variable needs to be removed.

Any help with this will be appreciated and this is resulting in way too many server errors.

Thanks
Hans

3
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by JorgeM
0

where is the source, who build that link. It not in our control if somebody refter your page like this.

Edited by urtrivedi

0

Ok, so if you know what the expected character length is going to be, retreive the querystring, then use the MID function to retreive the portion of the string you are interested in.

Mid(string,start[,length])

For example...

dim qs
qs = Request.QueryString("ID")
dim str
str = mid(qs,1,3)
Response.Write(str)

Edited by JorgeM

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.