Index
Data Management and Execution
In addition to communicating information, both administrators and users have the option to interact with the data through the use of actions. These processes can be executed as CGI but also as an executable file or script.
Originally, the system only handled CGIs, contained in the cgi-bin/ folder, but as needed, the option to run them as applications was added, which are located in the scripts/ folder.
Regardless of the language, or whether it is a CGI or a script, their purpose is solely to interact with, validate, and transform the data for storage in the database.
Its structure is generally as follows:
- Declaration of general debug variables and initial status.
- Loading external libraries
- Loading system libraries
- Declaration of constants and global variables
- Parameter recovery
- Declaration of internal functions
- Call validation (to prevent it from being executed from a different location)
- Normalization or standardization of received data types
- Validation of the action to be executed
- Validation of received data
- Execution of action if no errors are detected
- Return to the corresponding page
As you can see, every call is always validated. the information before making changes.
If everything is correct, return to the corresponding page; otherwise, indicate the fields in the submitted form where the error was detected or the corresponding error message.
It should be noted that before sending the information, the system validates the data. However, since there are values that may not be detected at this stage (it could be done via Ajax, but it would involve more unnecessary workload), the second validation is performed in the program before interacting with the database.