Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm studying making a CGI program. Now I can print text what I want. But how can I get GET or POST input from CGI program? (such as query-string or post-body)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The query string is accessible via the environmental variable called REQUEST_URI. If the client sent a POST request, then the contents will be available through the standard input.

See the Apache tutorial for a brief info (this is where the above sentences have been copied from).

By the way, most scripting language provides some kind of CGI support (for example, perl's CGI documentation is here), so the one you use surely has methods for extracting data from the request as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.