ASP Newbie Question

B

Brian Jorgenson

I have an ASP file querying 3 fields in a database. I have noticed on
many websites that use asp is that after the <page>.asp the have a ?
and then a field name = to a value. How does this work? How can I make
it work for me? For example one of my fields is NAME. if I have an asp
page called request.asp?name=bob then should I only get the record
for bob?
 
D

Dave Anderson

Brian said:
I have an ASP file querying 3 fields in a database. I have noticed on
many websites that use asp is that after the <page>.asp the have a ?
and then a field name = to a value. How does this work? How can I make
it work for me?

When an HTML FORM is submitted, it supplies either a querystring or a form
collection to its ACTION, depending on whether its METHOD is "get" or
"post". Name-value pairs come from successful controls. Example:

<form action="request.asp" method="get">
<input name="name" value="bob">
</form>

This form will produce your querystring: request.asp?name=bob. In contrast,
if the form METHOD is "post", there will be no querystring, but rather a
collection of name-value pairs submitted to request.asp in the headers.

Up to this point, this is simply an HTML question...


For example one of my fields is NAME. if I have an asp page
called request.asp?name=bob then should I only get the record
for bob?

....Now it becomes an ASP one. You can process the data in request.asp by
evaluating the proper collection elements:

Request.Form("name").Item (for "post")
Request.QueryString("name").Item (for "get")


Based on your question, I suggest you find an ASP tutorial, as I am glossing
over many things to provide a succinct answer.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
H

Hal Rosser

Brian Jorgenson said:
I have an ASP file querying 3 fields in a database. I have noticed on
many websites that use asp is that after the <page>.asp the have a ?
and then a field name = to a value. How does this work? How can I make
it work for me? For example one of my fields is NAME. if I have an asp
page called request.asp?name=bob then should I only get the record
for bob?

Dave answered your question
I'll just add that you can also append the "?" and the name=value pairs to
the url of a hyperlink.
Learn asp - you'll like it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top