Skip to content

Bronid/CGI-Interface-BookLibrary

Repository files navigation

CGI Interface BookLibrary

image

Table of Contents

General-info

Goal:

Develop a C++ program that implements a CGI interface Web server for creating and processing the database of library books.

My solution:

Using the capabilities of the sqlite3 library and the Apache server, I managed to write my own CGI interface in C ++ that provides the minimum functionality of a book library with the ability to add, delete, edit and search inside the database.

Technologies

Site-structure

  1. MainPage.cpp - index.cgi file, main page with all information and from which all actions are performed. Have GET request to filter library searches by parameters for the title of the book and the name of the author.
    URL: hostname/index.cgi
  2. AddToDB.cpp - AddToDB.cgi file, script gets data(book name, author, pages, etc...) from POST request and adds it to the database. URL: hostname/cgi-bin/AddToDB.cgi
  3. DeleteFromDB.cpp - DeleteFromDB.cgi file, script gets data(in this case - id) from POST request, then searches element by id in the table and deletes it. URL: hostname/cgi-bin/DeleteFromDB.cgi
  4. DropTable.cpp - DropTable.cgi file, script gets data(table name) from POST request, then drops table. URL: hostname/cgi-bin/DropTable.cgi
  5. EditDB.cpp - EditDB.cgi file, script gets data(id) from POST request, then searches element by id in the table and sets up their values in the HTML FORM, then gives possibility to change this datas. URL: hostname/cgi-bin/EditDB.cgi
  6. SaveEdit.cpp - SaveEdit.cgi file, script gets data(data from EditDB.cgi) then does UPDATE table with new data from EditDB.cgi. URL: hostname/cgi-bin/SaveEdit.cgi

Setup

  1. Download xampp or use this files.
  2. Compile .cpp files into .cgi file and rename it like in Site structure.
  3. Move all .cgi file in cgi-bin folder like here.
  4. Use this config file to use Apache server.
  5. Start Apache server via xampp application.
  6. Write into your URL: localhost

Done! =)

About

CGI Book Library application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published