InitCGI()

Syntax

Result = InitCGI([MaxRequestSize])
Description
Initializes the CGI environment. This function has to be called successfully before using any other commands of this library.

Parameters

MaxRequestSize (optional) The maximum request size, in bytes (default is 50 MB). When sending big data trough CGI (like binary files), it could be useful to specify a larger value.

Return value

Returns non-zero if the CGI environment has been correctly initialized.

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 - variables</title><body>" +
                 "Hello from PureBasic CGI !" +
                 "</body></html>")

See Also

ReadCGI()

Supported OS

All

<- FinishFastCGIRequest() - CGI Index - InitFastCGI() ->