CGIParameterValue()

Syntax

Result = CGIParameterValue(Name$ [, Index])
Description
Returns the value of the specified parameter.

Parameters

Name$ The name of the parameter to get the value. The parameter name is case-sensitive. CGIParameterName() can be used to get the name of a specified parameter. To get the number of available parameters, use CountCGIParameters(). This parameter will be ignored if an 'Index' is specified.
Index (optional) The index of the parameter to get the value. The first index value starts from 0. If specified, the 'Name$' parameter value is ignored (excepts if sets to #PB_Ignore).

Return value

Returns the value of the specified parameter.

Example

  If Not InitCGI() Or Not ReadCGI()
    End
  EndIf
  
  WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html", #PB_CGI_LastHeader) ; Write the headers to inform the browser of the content format
 
  WriteCGIString("<html><title>PureBasic - parameters</title><body>" +
                 "NbParameters: " + CountCGIParameters() + "<br><br>")
  
  ; List the all parameters and display their name and value
  ;
  For k = 0 To CountCGIParameters()-1 
    WriteCGIString(CGIParameterName(k) + ": " + CGIParameterValue("", k) + "<br>")
  Next
  
  WriteCGIString("</body></html>")

See Also

CountCGIParameters(), CGIParameterName(), CGIParameterType()

Supported OS

All

<- CGIParameterType() - CGI Index - CGIVariable() ->