PDA

View Full Version : query sting question-this one should be easy.


haskins
04-02-2003, 12:45 AM
one more quick stupid question about query stings .

Answer it if y ou like or just tell me to look it up i don't mind
just thought someone might know it off the top of there head

want to call
http://www.website.com/page.asp?FIELD=name&VALUE=name1*

Ok so how would you have it return a set of results containing two different names????????

Thanks,

whammy
04-02-2003, 01:31 AM
Ok, first of all:

?name=value

is a "name/value" pair.

So I'm assuming you want to return records where the same name might have a different value? No problem just make them a delimited string, and then split it. Although (as in my previous post) I would be wary of using querystring for this unless you validate that the data is of a type that cannot be used maliciously.

Can you explain in more detail what you're trying to do?

haskins
04-02-2003, 02:32 AM
http://www.website.com/page.asp?FIELD=apples&VALUE=macintosh*

i'd like this to return results from two apple types instead of just one.

Inother words I need results to show from both macintosh and granny smith of type apples.

Roy Sinclair
04-02-2003, 07:59 PM
A form can have multiple fields with the SAME name so you could get a url coming in like this:

http://www.test.not/page.asp?field=apple&type=GrannySmith&type=Macintosh

When you go to retrieve the "type" using Request.querystring you'll get an array instead of a single value. It's then just a simple matter of handing the result.