newman     VBWeb     VBSource     Portfolio    
OUT ON THE INTERNET


Home

Getting Started
- Hello World Example
- SampleMain Example
- Code Snippets
- Request Collection
- Missing Terms
- Multi-Select
- Names Collection

User Guide
- Debugging
- Stepping Through Code
- HTML Templates
- Cookies

Command Reference
- AddToRequest
- BackupRequest
- CgiDebugPrint
- ErrorHandler
- Escape
- Extract
- FileContents
- FileExists
- GetRequest
- GmtDate
- IsVBIDE
- LoadRequest
- Parse
- Redirect
- Replace
- Send
- SendLn
- ServerVariables
- SetCookie
- StandardIn
- UrlDecode
- UrlEncode

Appendix
- Web Server Directory Mapping
- Computer Name & IP Address

Code Snippets

MAIN

REQUEST
This page contains short clips of code that uses the Request collection. This might be enough for an experienced VB programmer. But don't wary if you don't get it. The next page gives lots of details.
 
If the visitor enters Hancock in a text box named LastName, the following VB statement is true. The (1) is needed.
Request("LastName")(1) = "Hancock"
If the visitor puts a check in a check box named IsMarried, the following VB statement is true.
GetRequest("IsMarried") > ""
The following makes a comma delimited list of all the values the visitor selected in a multi-select list box named Products. If nothing was selected then the list is left empty.
If GetRequest("Products") > "" Then
  For Each Prod In Request("Products")
    List = List & ", " & Prod
  Next
  'Chop off leading comma.
  List = Mid(List, 3)
End If
This one does the same thing using an index instead of For Each.
If GetRequest("Products") > "" Then
  For i = 1 To Request("Products").Count
    List = List & ", " & Request("Products")(i)
  Next i
  'Chop off leading comma.
  List = Mid(List, 3)
End If
The following lists the names of all the inputs in the form submitted with the number of values for each. For Each Name In Names SendLn Name, Request(Name).Count, "<BR>" Next
top

MAIN

REQUEST


Copyright 1997 NEWMAN Services Corp. All rights reserved.
973-228-5753 pres@newmanservices.com