Could someone please take a look at this code. I think I have a small mistake somewhere but I am not sure where:
Function:
Function GetValue(Querystring, Name)
'Querystrings are broken up into a series of name value pairs.
'The purpose of this function is to return a value corresponding to the name passed as a parameter
Dim strQueryString, strName, valueStart, valueEnd, strValue
strQueryString = QueryString
strName = Name
'starting position of the value
valueStart = InStr(1, strQuerystring, strName)+Len((strName) + 1)
'get the location of the '&' after the Value
valueEnd = InStr(valueStart, strQuerystring, "&"
'get the value
strValue = Mid(strQuerystring, valueStart, valueEnd - valueStart)
GetValue = strValue
End Function
Querystring:
deviceid=0.2268606658.587869489&zipcode=00000&Fund=FFTN&asp=modules/OH/default.asp
If I pass 'Fund' as the name parameter what I expect:
FFTN
What I am actually getting:
eviceid=0.2268606658.587869489
I think I may have the wrong syntax for using the Len statement but I have tried it loads of different ways and can't figure it out.
Any help would be appreciated,
Thank You
Function:
Function GetValue(Querystring, Name)
'Querystrings are broken up into a series of name value pairs.
'The purpose of this function is to return a value corresponding to the name passed as a parameter
Dim strQueryString, strName, valueStart, valueEnd, strValue
strQueryString = QueryString
strName = Name
'starting position of the value
valueStart = InStr(1, strQuerystring, strName)+Len((strName) + 1)
'get the location of the '&' after the Value
valueEnd = InStr(valueStart, strQuerystring, "&"
'get the value
strValue = Mid(strQuerystring, valueStart, valueEnd - valueStart)
GetValue = strValue
End Function
Querystring:
deviceid=0.2268606658.587869489&zipcode=00000&Fund=FFTN&asp=modules/OH/default.asp
If I pass 'Fund' as the name parameter what I expect:
FFTN
What I am actually getting:
eviceid=0.2268606658.587869489
I think I may have the wrong syntax for using the Len statement but I have tried it loads of different ways and can't figure it out.
Any help would be appreciated,
Thank You