Dynamic-CD
Search : 
  Powered by FindinSite

ASP Documentation
Overview
• Introduction
• Getting started
• Dynamic-CD wizard
Passwords & Encryption
• Overview
• Example 1
• Example 2
Scripts
• The script language
• Script examples
• Database scripts
Technical details
• Applications
• Built-in objects
• Character Encoding
• Cookies
• Database CDs
• Development tips
• FAQs
• Future developments
• Global.asa
• Network support
• Object registration
• Resources
• ScriptingContext
• Server-side includes
• Sessions
• Technical limits
    
Script example 4

Exercising ASP features
Here are examples of the use of ASP features that have not been demonstrated in the other examples.


Request.ServerVariables
This call returns a number of useful parameters, including :
  • HTTP_REFERER is the URL that called this script
  • HTTP_HOST is the name of the host
  • SERVER_NAME is the name of the host
  • URL is the URL of this script
  • SCRIPT_NAME is the URL of this script
  • QUERY_STRING is the query string attached to the the URL
  • HTTP_USER_AGENT is information about the browser
  • HTTP_ACCEPT_LANGUAGE is the browser's language setting
  • ALL_RAW is the raw HTTP header data
  • ROOT_DIR is the DOS path of the Dynamic-CD root directory
  • WINDOWS_TEMP_DIR is the path of the current user's Windows temporary directory

Use the ROOT_DIR to locate support files - such as a database - on the CD.

Use the WINDOWS_TEMP_DIR to write "temporary" information to the user's hard disk. Customisation could be supported by writing user settings to the Windows temporary directory, and recovering it when starting a new session. Writing to the user's hard disk should be done with care, after warning the user.

ASP CODE
<%
  for each thing in Request.ServerVariables
      Response.Write "<LI>" + thing + " = "
      Response.Write Request.ServerVariables( thing)
  next
%>


Server.ScriptTimeout
If a script takes too long to process, Dynamic-CD terminates the script after 30 seconds. You can change this default value as shown in the following example.

ASP CODE
<%
    Server.ScriptTimeout = 10

    '-------------------------
    'get into an infinite loop
    WHILE TRUE
    WEND
%>


© Copyright 2000-2007 PHD Computer Consultants Ltd