ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Search For:



Intro to ASP


 


The ASP On Line Course:
Using the REQUEST Object

ASP is very commonly used to process form requests - having the user type in something, and then either mailing or storing or writing this information out. Learn more about how the request object works and how to use it to boost your website's functionality.

The REQUEST object is a way that information is passed from one webpage to another. Usually this is done by creating a link that looks something like this:

http://www.aspisfun.com/SendMessage.asp?username=Lisa&email=lshea@earthlink.net

The ? after the URL lets your code know that anything after the ? is values for you to work with. Each name-value pair is separated by an &. You can have as many pairs as you wish.

This same syntax is generated by a GET type of form. To create this, you would create a form something like this on a webpage:

<FORM action="SendMessage.asp" method="GET>
What is your username? <INPUT TYPE="TEXT" NAME="username">
What is your email address? <INPUT TYPE="TEXT NAME="email">

So in essence, the form is just like any regular HTML form. You can now use your ASP script to process the results of the form, and do whatever you want with that information.

Let's take a look at the SendMessage.asp file that this information is being sent to - either by a direct URL link or through this form. It's very easy to get your hands on that incoming information!

UserName = Request("username")
EmailAddress = Request("email")
Response.write "The username submitted is: " & UserName
Response.Write " and the email address submitted is: " & EmailAddress

That's it! Just use Request(fieldname) to get your hands on the value in any fieldname being passed in. You can then use this information to send mail messages, write information to the database, customize your webpages, and much, much more.

Free Online ASP Course


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2010 Minerva WebWorks LLC. All rights reserved.

Irish Wedding


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error