Configure CGI script » History » Version 5
« Previous -
Version 5/6
(diff) -
Next » -
Current version
Maarten Plieger, 09/09/2016 07:13 AM
Configure CGI script¶
BEFORE USE:
Create the database before using. See Database_structure
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
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.