Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Variables Types

Posted 19 Apr 2002 18:04:25
1
has voted
19 Apr 2002 18:04:25 aegis kleais posted:
Can someone explain what the following are? I've given my assumption to what each is, but if it's incorrect, do you mind correcting me?

Request.Cookie - I assume you place the name of the stored cookie and it reads the value of it and assigns it to this data src
Request.Form - I assume you place the name of a form element on the current page and this variable takes the same value
Request.QueryString - I assume this query's the URL string to find the name supplied and see it's value
Request.ServerVariables - I assume you set the name to a server variable name (ie, REMOTE_ADDR for IP) or a list of other variables, and assigns it to this data src

Session Variable - I don't understand this. All it asks for is a name. So I can't set a value to it. I assumed that a session variable is a variable that once created, exists across all pages (without need to pass it in the URL) and expires when the browser is closed or a session is abandoned.

Application Variable - I have no idea what this is, but like Session, it only asks for a name and I can't seem to set a value to it. (Aren't variables VariableName = Value pairs?)

Any clarification is much appreciated. Web Design & Dev is sweet!

Replies

Replied 19 Apr 2002 21:35:41
19 Apr 2002 21:35:41 Joel Martinez replied:
here ya go
Request.Cookie
usage:
Response.Cookie("hoser" = "my name"
thename = Request.Cookie("hoser"

Request.Form
requires an input field of that name to be posted to that page
usage
thename = Request.Form("hoser"

Request.QueryString
a url like this
www.site.com/page.asp?hoser=my+name
usage:
thename = Request.QueryString("hoser"

Request.ServerVariables
usage:
userIP = Request.ServerVariables("remote_addr"

Session variable
usage:
Session("ID" = 1
myID = Session("ID"

Application Variable
usage:
Application("ID" = 1
myID = Application("ID"

The only difference between a session variable, and an application variable, is that the session is only available to that user, the application is available to all users.


Joel Martinez
MX inSite Magazine
The Complete Resource for Macromedia designers & developers
Sign up for your free electronic Preview Issue
www.mxinsite.com

Reply to this topic