iClarifying some CGI stuff. - geomyidae - A small C-based gopherd. Err bitreich.org 70 hgit clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ URL:git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ bitreich.org 70 1Log /scm/geomyidae/log.gph bitreich.org 70 1Files /scm/geomyidae/files.gph bitreich.org 70 1Refs /scm/geomyidae/refs.gph bitreich.org 70 1Tags /scm/geomyidae/tag bitreich.org 70 1README /scm/geomyidae/file/README.gph bitreich.org 70 1LICENSE /scm/geomyidae/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 6dd2752f4e89d9d8e5f5a9608b66a35b81dbc2b4 /scm/geomyidae/commit/6dd2752f4e89d9d8e5f5a9608b66a35b81dbc2b4.gph bitreich.org 70 1parent 7114924898ed83d3a4eb3f0a59f9047ed3877ba4 /scm/geomyidae/commit/7114924898ed83d3a4eb3f0a59f9047ed3877ba4.gph bitreich.org 70 hAuthor: Christoph Lohmann <20h@r-36.net> URL:mailto:20h@r-36.net bitreich.org 70 iDate: Wed, 16 Mar 2011 05:11:13 +0100 Err bitreich.org 70 i Err bitreich.org 70 iClarifying some CGI stuff. Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M CGI | 30 +++++++++++++++++++++++------- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 23 insertions(+), 7 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/CGI b/CGI /scm/geomyidae/file/CGI.gph bitreich.org 70 i@@ -9,7 +9,7 @@ There are two modes: standard cgi and dynamic cgi. Err bitreich.org 70 i Err bitreich.org 70 i PERMISSIONS Err bitreich.org 70 i Err bitreich.org 70 i-The scripts are run using the permissions of geomyidae. It is adived to use Err bitreich.org 70 i+The scripts are run using the permissions of geomyidae. It is adivsed to use Err bitreich.org 70 i the -g and -u option of gemoyidae. Err bitreich.org 70 i Err bitreich.org 70 i Err bitreich.org 70 i@@ -21,38 +21,50 @@ sending. Err bitreich.org 70 i Err bitreich.org 70 i CALLING CONVENTION Err bitreich.org 70 i Err bitreich.org 70 i+Geomyidae will call the script like this: Err bitreich.org 70 i+ Err bitreich.org 70 i % $gopherroot/test.cgi $search $arguments Err bitreich.org 70 i Err bitreich.org 70 i+When it is a plain request, the arguments will have these values: Err bitreich.org 70 i+ Err bitreich.org 70 i C: /test.cgi Err bitreich.org 70 i -> $search = "" Err bitreich.org 70 i -> $arguments = server host Err bitreich.org 70 i Err bitreich.org 70 i+If the request is for a type 7 search element, then the entered string by Err bitreich.org 70 i+the user will be seen as following: Err bitreich.org 70 i+ Err bitreich.org 70 i C: /test.cgi searchterm (There is a Tab inbetween) Err bitreich.org 70 i -> $search = »searchterm« Err bitreich.org 70 i -> $arguments = server host Err bitreich.org 70 i Err bitreich.org 70 i- C: /test.cgi?hello=world Err bitreich.org 70 i+When you are trying to give your script some calling arguments, the syntax Err bitreich.org 70 i+is: Err bitreich.org 70 i+ Err bitreich.org 70 i+ C: /test.cgi?hello Err bitreich.org 70 i -> $search = "" Err bitreich.org 70 i- -> $arguments = »hello=world« Err bitreich.org 70 i+ -> $arguments = »hello« Err bitreich.org 70 i+ Err bitreich.org 70 i+If borth ways of input are combined, the variables are set as following: Err bitreich.org 70 i Err bitreich.org 70 i C: /test.cgi?hello=world searchterm (Beware! A Tab!) Err bitreich.org 70 i -> $search = »searchterm« Err bitreich.org 70 i -> $arguments = »hello=world« Err bitreich.org 70 i Err bitreich.org 70 i-The examples should be enough for understanding it. Err bitreich.org 70 i- Err bitreich.org 70 i Err bitreich.org 70 i STANDARD CGI Err bitreich.org 70 i Err bitreich.org 70 i The file extension »cgi« switches to this mode, where the output of the Err bitreich.org 70 i-script is not interpreted at all by the server and the client needs to send Err bitreich.org 70 i-raw Gopher menus/files. Err bitreich.org 70 i+script is not interpreted at all by the server and the script needs to send Err bitreich.org 70 i+raw content. Err bitreich.org 70 i Err bitreich.org 70 i % cat test.cgi Err bitreich.org 70 i #!/bin/sh Err bitreich.org 70 i echo "Hello my friend." Err bitreich.org 70 i % Err bitreich.org 70 i Err bitreich.org 70 i+The client will receive: Err bitreich.org 70 i+ Err bitreich.org 70 i S: Hello my friend. Err bitreich.org 70 i Err bitreich.org 70 i Err bitreich.org 70 i@@ -67,7 +79,11 @@ mat is the same as in the *.gph files. Err bitreich.org 70 i echo "[1|Some link|/somewhere|server|port]" Err bitreich.org 70 i % Err bitreich.org 70 i Err bitreich.org 70 i+Here geomyidae will interpret the *.gph format and return the valid gopher Err bitreich.org 70 i+menu item. Err bitreich.org 70 i+ Err bitreich.org 70 i S: 1Some link /somewhere gopher.r-36.net 70 Err bitreich.org 70 i Err bitreich.org 70 i+ Err bitreich.org 70 i Have fun! Err bitreich.org 70 i Err bitreich.org 70 .