Project

General

Profile

Configure CGI script » History » Version 3

« Previous - Version 3/6 (diff) - Next » - Current version
Rob Tjalma, 08/26/2016 01:27 PM


Configure CGI script

Instructions about how to create a CGI script for connecting to the SQLite database.

Script example

#!/bin/sh

echo

QUERY_STRING = "$QUERY_STRING" 

# The name of the database
export DB_NAME="name.db" 

python path/to/file.py $QUERY_STRING $DB_NAME

Very easy CGI script.
The QUERY_STRING variable contains all the query parameters in the URL.

Example:

http://example.example/webservice/test.cgi?q=value&callback=function

QUERY_STRING will give you:

q=value&callback=function

Second argument is the name of the database.

The python file in the repository takes one argument, the QUERY_STRING value.