logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
European Travel
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g ASP Site

BellaOnline's ASP Editor

g

System ServerRequest Variables


When your ASP script starts running, it has quite a number of system variables that help it perform tasks based on the browser the user is using, the type of computer they are running on, the language accepted, and much more. You can then customize your HTML so that it is just perfect for IE, or perfect for Netscape, or uses fonts for a Macintosh, and much more.

Here are some commmonly used server variables.

Variable NameFunction
HTTP_USER_AGENTBrowser the user is running
HTTP_UA_OSOperating system the user is running
HTTP_ACCEPT_LANGUAGELanguage the user wants
REMOTE_HOSTIP address of the user
GET_METHODGET or POST
HTTP_REFERERThe previous page the user came from


For example, here is a block of code that writes out the appropriate stylesheet entry to the page based on which type of browser the user is running.

Dim ServerVar
Set ServerVar = Request.ServerVariables
BrowserName = ServerVar("HTTP_USER_AGENT")
OpSys = ServerVar("HTTP_UA_OS")

'SHOW STYLESHEET FOR MATCHING SYSTEM'
if InStr(BrowserName, "MSIE") > 0 and InStr(BrowserName, "Win") > 0 then
Response.Write ""
end if
if InStr(BrowserName, "MSIE") > 0 and InStr(BrowserName, "Win") = 0 then
Response.Write ""
end if
if InStr(BrowserName, "MSIE") = 0 and InStr(BrowserName, "Win") > 0 then
Response.Write ""
end if
if InStr(BrowserName, "MSIE") = 0 and InStr(BrowserName, "Win") = 0 then
Response.Write ""
end if

Introduction to ASP Ebook

Download this ebook to get everything you need to know about learning ASP - from a step by step tutorial to function lists, sample code, common errors and solutions, and much more! 101 pages.
Add System+ServerRequest+Variables to Twitter Add System+ServerRequest+Variables to Facebook Add System+ServerRequest+Variables to MySpace Add System+ServerRequest+Variables to Del.icio.us Digg System+ServerRequest+Variables Add System+ServerRequest+Variables to Yahoo My Web Add System+ServerRequest+Variables to Google Bookmarks Add System+ServerRequest+Variables to Stumbleupon Add System+ServerRequest+Variables to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact Lisa Shea for details.

g


g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor