This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/ksh | |
| # Function to create the SQLite database and table if they don't exist | |
| create_database() { | |
| if [ ! -f guestbook.db ]; then | |
| sqlite3 guestbook.db 'CREATE TABLE entries (id INTEGER PRIMARY KEY AUTOINCREMENT, message TEXT)' | |
| fi | |
| } | |
| # Function to fetch and display guestbook entries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import cgi | |
| import sqlite3 | |
| # Create or connect to the SQLite database | |
| conn = sqlite3.connect('gb.db') | |
| cursor = conn.cursor() | |
| # Create a table to store guestbook entries if it doesn't exist |
OlderNewer