cl.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <html><head><title>CGI Command line options</title></head><body><h1><img alt="" src="cl_files/CGIlogo.gif"> CGI Command line options</h1>
  2. <hr> <p>
  3. </p><h2>Specification</h2>
  4. The command line is only used in the case of an ISINDEX query. It is
  5. not used in the case of an HTML form or any as yet undefined query
  6. type. The server should search the query information (the <code>QUERY_STRING</code> environment variable) for a non-encoded
  7. = character to determine if the command line is to be used, if it
  8. finds one, the command line is not to be used. This trusts the clients
  9. to encode the = sign in ISINDEX queries, a practice which was
  10. considered safe at the time of the design of this specification. <p>
  11. For example, use the <a href="http://hoohoo.ncsa.uiuc.edu/cgi-bin/finger">finger script</a> and the ISINDEX interface to look up "httpd". You will see that the script will call itself with <code>/cgi-bin/finger?httpd</code> and will actually execute "finger httpd" on the command line and output the results to you.
  12. </p><p>
  13. If the server does find a "=" in the <code>QUERY_STRING</code>,
  14. then the command line will not be used, and no decoding will be
  15. performed. The query then remains intact for processing by an
  16. appropriate FORM submission decoder.
  17. Again, as an example, use <a href="http://hoohoo.ncsa.uiuc.edu/cgi-bin/finger?httpd=name">this hyperlink</a> to submit <code>"httpd=name"</code> to the finger script. Since this <code>QUERY_STRING</code>
  18. contained an unencoded "=", nothing was decoded, the script didn't know
  19. it was being submitted a valid query, and just gave you the default
  20. finger form.
  21. </p><p>
  22. If the server finds that it cannot send the string due to internal
  23. limitations (such as exec() or /bin/sh command line restrictions) the
  24. server should include NO command line information and provide the
  25. non-decoded query information in the environment
  26. variable <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html#query"><code>QUERY_STRING</code></a>. </p><p>
  27. </p><hr>
  28. <h2>Examples</h2>
  29. Examples of the command line usage are much better <a href="http://hoohoo.ncsa.uiuc.edu/cgi/examples.html">demonstrated</a> than explained. For these
  30. examples, pay close attention to the script output which says what
  31. argc and argv are. <p>
  32. </p><hr>
  33. <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html"><img alt="[Back]" src="cl_files/back.gif">Return to the
  34. interface specification</a> <p>
  35. CGI - Common Gateway Interface
  36. </p><address><a href="http://hoohoo.ncsa.uiuc.edu/cgi/mailtocgi.html">cgi@ncsa.uiuc.edu</a></address>
  37. </body></html>