💾 Archived View for gemini.bunburya.eu › newsgroups › gemini › messages › slrnsvp1gf.1fa.vlad@happy.… captured on 2024-08-25 at 00:03:50. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-04-28)

-=-=-=-=-=-=-

Re: Programming CGI

Message headers

From: Vlad Markov <vlad@happy.dwarf7.net>

Subject: Re: Programming CGI

Date: Fri, 4 Feb 2022 01:49:03 -0000 (UTC)

Message-ID: <slrnsvp1gf.1fa.vlad@happy.dwarf7.net>

Message content

On 2022-02-02, Martin <martin@datapulp.de> wrote:

Hi. I recently thought about trying out some CGI on gmid from omar polo.
Do you have some pointers for some very basic examples for me to
understand, how it works? Are there variables specific to Gemini? Is
there a preferred subset that is know to work on must supporting servers?
Ciao
Martin

I use gemserv as my gemini server. The documentation was in the "README" file

that came with it.

CGI Environments

These variables are preset for you. If you need more you can define them in the

config file under "cgienv"

- GEMINI_URL

- SERVER_NAME

- SERVER_PROTOCOL

- SERVER_SOFTWARE

- SCRIPT_NAME

- REMOTE_ADDR

- REMOTE_HOST

- REMOTE_PORT

- QUERY_STRING

- PATH_INFO

TLS variables

- AUTH_TYPE

- TLS_CLIENT_HASH

- REMOTE_USER

A simple script. The user types in something and it is echoes back:

!/usr/bin/perl

$buffer = $ENV{'QUERY_STRING'};

if (defined $buffer ){

print "20 text/gemini; charset=utf-8 \r\n";

print "#CGI page \r\n";

print "Your name is $buffer \r\n";

} else {

print "10 What is your name \r\n";

}

enjoy

Related

Parent:

Programming CGI (by Martin <martin@datapulp.de> on Wed, 2 Feb 2022 07:51:10 +0100)

Children:

Re: Programming CGI (by Gustaf Erikson <gerikson@gmial.com> on Fri, 04 Feb 2022 09:29:42 +0100)

Re: Programming CGI (by nytpu <alex@nytpu.com> on Sat, 5 Feb 2022 00:16:22 -0000 (UTC))

Re: Programming CGI (by bunburya <bunburya@tilde.club> on Sun, 6 Feb 2022 19:21:20 +0000)