4D v14.3

WEB GET VARIABLES

Home

 
4D v14.3
WEB GET VARIABLES

WEB GET VARIABLES 


 

WEB GET VARIABLES ( nameArray ; valueArray ) 
Parameter Type   Description
nameArray  Text array in Web form variable names
valueArray  Text array in Web form variable values

The WEB GET VARIABLES command fills the text arrays nameArray and valueArray with the variable names and values contained in the Web form “submitted” (i.e. sent to the Web server).

This command gets the value for all the variables which can be included in HTML pages: text area, button, checkbox, radio button, pop up menu, choice list...

Note: Regarding checkboxes, the variable name and value are returned only if the checkbox has been actually checked.

This command is valid regardless of the type of URL or form (POST or GET method) sent to the Web server.

This command can be called, if necessary, in the On Web Connection Database Method or any other 4D method resulting from a form submission.

Each form contains named data entry area (text area, buttons, checkboxes).
When a form is submitted (a request is sent to the Web server), the request contains (within others) the list of the data entry areas and their associated values.
A form can be submitted through two methods (both can be used with 4D):

  • POST, usually used to add data into the Web server - to a database,
  • GET, usually used to request the Web server - data coming from a database.

Example  

A form contains two fields, vName and vCity with “ROBERT” and “DALLAS” values. The action associated to the form is “/4DACTION/WEBFORM”.

  • If the form method is POST (most frequently used), the data entered will not be visible in the URL (http://127.0.0.1/4DACTION/WEBFORM).
  • If the form method is GET, the data entered will be visible in the URL (http://127.0.0.1/4DACTION/WEBFORM?vNAME=ROBERT&vCITY=DALLAS).

The WEBFORM method can be as follows:

 ARRAY TEXT($anames;0)
 ARRAY TEXT($avalues;0)
 WEB GET VARIABLES($anames;$avalues)

The result will be:

 $anames{1}="vNAME"
 $anames{2}="vCITY"
 $avalues{1}="ROBERT"
 $avalues{2}="DALLAS"

The vNAME variable contains ROBERT and the vCITY variable contains DALLAS.

 
PROPERTIES 

Product: 4D
Theme: Web Server
Number: 683

 
HISTORY 

Modified: 4D 2004
Renamed: 4D v13

 
SEE ALSO 

Binding 4D objects with HTML objects
URLs and Form Actions
WEB GET BODY PART

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : GET WEB FORM VARIABLES ( 4D v12.4)