FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
January 01, 2002

Writing CGI Scripts in REXX (Web Techniques, May 1996)

(Page 14 of 23)

Writing CGI Scripts in REXX, Listing 2 (Web Techniques, May 1996)

Web Techniques Magazine

May 1996

Volume 1, Issue 2





Writing CGI Scripts in REXX



Listing Two

ReadPost: PROCEDURE; PARSE ARG StdinFile

/******************************************** */

/*Read HTML FORM POST input (if any) from */

/*standard input. Note that if the caller */

/*provides a filename then we save the input */

/*in case we need to send it to another */

/*script. If so we can restore the stdin for */

/*the called command by using the command: */

/*ADDRESS UNIX script '<' StdinF. */

/*A good way to get a unique filename to save */

/*the standard input in, is to use the process*/

/*id. For example: */

/* StdinFile='/tmp/stdin'_GETPID() */

/* Post=ReadPost(StdinFile) */

/*_GETPID() provides the process ID in UniREXX*/

/*ReadPost returns the POST input if the */

/*REQUEST_METHOD="POST" else it returns null. */

/*N.b. the returned Post input does NOT have */

/*plus signs (+) converted to spaces or hex */

/* ASCII %XX encodings converted to characters*/

/******************************************** */

In=''

IF GETENV('REQUEST_METHOD')="POST" THEN DO

In=CHARIN(,1,GETENV('CONTENT_LENGTH'))

IF In='' THEN DO

SAY '400: Null input from POST!'; EXIT

END

IF StdinFile/='' THEN DO

IF CHAROUT(StdinFile,In,1) /=0 THEN DO

SAY '500: Unable to write out all POST chars!'

EXIT

END

Fail=CHAROUT(StdinFile) /*Close the file*/

END

END

RETURN In



( back )


Copyright Web Techniques. All rights reserved.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 Next Page
TOP 5 ARTICLES
No Top Articles.
DR. DOBB'S CAREER CENTER
Ready to take that job and shove it? open | close
Search jobs on Dr. Dobb's TechCareers
Function:

Keyword(s):

State:  
  • Post Your Resume
  • Employers Area
  • News & Features
  • Blogs & Forums
  • Career Resources

    Browse By:
    Location | Employer | City
  • Most Recent Posts:
    MEDIA CENTER  more
    NetSeminar
    Modernize your Development by Moving Build and Code Quality Upstream
    Moderated by Jon Erickson, Editor-in-Chief of Dr. Dobb's, this interactive panel discussion brings industry experts Anders Wallgren, CTO of Electric Cloud and Gwyn Fisher, CTO of Klocwork together for a candid discussion of the cost savings, productivity and quality benefits that can be achieved by stabilizing builds and code quality as early in the development cycle as possible.

    The reality of today's development environment - geographically distributed teams, the use of Agile development practices, increasing application complexity, etc. - is straining the viability of the traditional coding, build and release process. To stay ahead of the curve, development teams are modernizing their approach to dealing with these issues, and as a result are achieving new levels of development productivity. Register for the webcast.
    Date: Wednesday, July 15, 2009
    Time: 11 am PT/2 pm ET
    Modernize your Development by Moving Build and Code Quality Upstream
    Moderated by Jon Erickson, Editor-in-Chief of Dr. Dobb's, this interactive panel discussion brings industry experts Anders Wallgren, CTO of Electric Cloud and Gwyn Fisher, CTO of Klocwork together for a candid discussion of the cost savings, productivity and quality benefits that can be achieved by stabilizing builds and code quality as early in the development cycle as possible.

    The reality of today's development environment - geographically distributed teams, the use of Agile development practices, increasing application complexity, etc. - is straining the viability of the traditional coding, build and release process. To stay ahead of the curve, development teams are modernizing their approach to dealing with these issues, and as a result are achieving new levels of development productivity. Register for the webcast.
    Date: Wednesday, July 15, 2009
    Time: 11 am PT/2 pm ET
                                   
    INFO-LINK

    Resource Links: