IBM AS/400E Network Router User Manual


 
**************************************************************************
* Start of CGI Program execution section...
**************************************************************************
* Initialize error code structure for error ids.
* This allows for 7 bytes in QUSEI for error message id.
C Z-ADD 16 QUSBPRV
**************************************************************************
**** Read the Environment variable, REQUEST_METHOD.
**************************************************************************
C MOVEL EnvMethod EnvName
C Z-ADD 14 EnvNameLen
C callb APIGetEnv
C parm EnvRec
C parm EnvRecLen
C parm EnvLen
C parm EnvName
C parm EnvNameLen
C parm QUSEC
C MOVEL EnvRec EnvMDResp
**************************************************************************
**** Is the REQUEST_METHOD, POST?
C 4 subst EnvRec:1 EResp
C EResp ifeq 'POST'
**************************************************************************
* Get Environment Variable 'Content_Length' using 'QtmhGetEnv' API
C MOVEL EnvCL EnvName
C Z-ADD 14 EnvNameLen
C CALLB APIGetEnv
C parm EnvRec
C parm EnvRecLen
C parm EnvLen
C parm EnvName
C parm EnvNameLen
C parm QUSEC
* Convert Content_Length to numeric.
C eval ContentLn=c2n(EnvRec)
* When the Content Length is greater than the buffer, Read maxdataln.
C ContentLn ifgt maxdataln
C Z-ADD maxdataln ContentLn
C endif
* Specify InDataLn to Content_Length value. Never should a CGI program
* ever attempt to read more than content length. Specification of more
* than content length in InDataLn is not defined.
C Z-ADD ContentLn BufInLn
**************************************************************************
* Read standard input
C callb APIStdIn
C parm BufIn
C parm BufInLn
C parm StdInLn
C parm QUSEC
C MOVEL StdInLn Result
C else
**************************************************************************
**** Read the Environment variable, QUERY_STRING.
**************************************************************************
C MOVEL EnvQS EnvName
C Z-ADD 12 EnvNameLen
C callb APIGetEnv
C parm EnvRec
C parm EnvRecLen
C parm EnvLen
C parm EnvName
C parm EnvNameLen
C parm QUSEC
**************************************************************************
**** Check length of environment value is less than
102 Web Programming Guide V4R5