# 11. Program CGIentry

## 11.1 Purpose

Program CGIentry (cgientry.exe) provides SCIOS access through the Internet or intranet. It is installed in the cgi-bin directory on a web server. All user access to SCIOS files is accomplished through this program -- an important security feature.

## 11.2 Architecture

- The server computer has all SCIOS system software, data files, and support files installed.
- Client computers need only a web browser (no SCIOS software installed locally).
- A world-wide system with a thousand terminals need not have any SCI software on the remote computers.

## 11.3 Starting CGIentry

The process is started by entering a URL such as:
```
http://vaio/cgientry.htm
```

This webpage presents:
1. A **Submit** button
2. A **Command** field (1 character)
3. A **Number** field (5 digits, record number)
4. A **Display File** field (8 characters, filename prefix)
5. A **Data File** field (8 characters, filename prefix)
6. A **Procedure** field (8 characters, filename prefix)
7. A **Message** field (35 characters)

The user display appears below these command fields.

## 11.4 Commands

| Command | Action |
|---------|--------|
| `A` | **Advance** -- Retrieve and display record n+1 |
| `B` | **Backup** -- Retrieve and display record n-1 |
| `E` | **End** -- Position to end-of-file, display blanks |
| `G` | **Go** -- Write current record, then advance (equivalent to W then A) |
| `N` | **Number** -- Position to the record number in the Number field |
| `S` | **Start** -- Load the specified display, data, and procedure files at the given record number |
| `W` | **Write** -- Send field contents to server and write to data file at current position |
| `X` | **Execute** -- Send field contents to server, execute the named Chaprola procedure, write result to data file |

## 11.5 Workflow

1. Enter `S` in Command, a record number in Number, file prefixes in Display/Data/Procedure fields.
2. Click Submit -- the named display appears with data from the named file at the named record.
3. Edit data in the display fields.
4. Enter `W` and click Submit to save, or `X` to execute a Chaprola procedure.
5. The procedure may change not only the data record but also the command fields (enabling menu navigation).

## 11.6 HTML Display Files

The .HTM display file is generated by Program HTMLPREP from the same text file and format file used for .DI files. The HTML file is an HTTP form that posts to cgientry.exe.

### Hidden Fields in the HTML Form

| Field Name | Size | Purpose |
|------------|------|---------|
| `SCIident` | 7 | Form identifier |
| `Oldnumb` | 5 | Previous record number |
| `Olddisp` | 8 | Previous display file |
| `Olddata` | 8 | Previous data file |
| `Command` | 1 | Single-character command |
| `Numb` | 5 | Record number |
| `Disp` | 8 | Display file prefix |
| `Data` | 8 | Data file prefix |
| `Proc` | 8 | Procedure file prefix |
| `Message` | 35 | Status/error messages |
| `SCIfinis` | 4 | Form terminator |

Data fields are named `a001`, `a002`, etc., corresponding to the field numbers.

## 11.7 Security

Only the person who installs cgientry.exe in the cgi-bin directory has direct access to SCIOS files. All other user access is mediated through the program. This is an extremely important security feature.

---

*Previous: [SCIEDIT](10-sciedit.md) | Next: [Ecosystem Programs](12-ecosystem.md)*
