Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:17:55+00:00 2026-05-27T12:17:55+00:00

I wrote a simple webform that will take the user’s information (via POST) and

  • 0

I wrote a simple webform that will take the user’s information (via POST) and insert it into a database. This isn’t my typical type of programming, but it was basic enough that I didn’t have any trouble.

Anyway, the web form exists in an html page, and is pretty standard. Something like the following (simplified example):

<form method="post" action="/cgi-bin/submit_form" enctype="x-www-form-encoded" id="frm">
   <input id="txtName" type="text" />
   <input id="txtPhone" type="text" />   
   <input id="btnSubmit" type="submit" value="Submit" />
</form>

And I have a C++ application (cgi-bin/submit_form) that runs when it is submitted and stores the data in a database.

I wrote a very basic CGI library that essentially parses the output, which looks something like this:

txtName=<name>&txtPhone=<phone>&btnSubmit=Submit

And the library parses it into a map<string, string> like this:

myMap["txtName"] = "John";
myMap["txtPhone"] = "1.800.555.5555";

Which is then pretty easy to put in the database. However, it is quite evident that my application is completely dependent on the html element variable names (txtName, txtPhone). If any of those are changed, my application suddenly stops working.


My question is: How can you synchronize the process of getting data from CGI into a server-side application?

I am very lucky that I’m in charge of both the html and the server-script. But there must be scenarios where one person manages the website and another person manages the scripting, and they must coordinate somehow to ensure nothing bad happens.

In these types of situations, an ICD may be used. For example, when passing XML data, one might use an XSD to define the data structure.

Is there anything like this with CGI programming? I am very frightened at how fragile and easy to break my application is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:17:56+00:00Added an answer on May 27, 2026 at 12:17 pm

    You’re referring to the changes between the HTML element names versus the fields being parsed by your CGI script?

    As far as something so formal as XSD, I don’t believe so.

    Generally, this is the same class of solutions as

    • the Unix shell command-line system;
    • Environment variables;
    • HTTP and SMTP header fields;

    … i.e. the POST values are completely free-form strings, and up to your server to read, ignore, or complain about, at-will. (Just as you can freely include “garbage” in your environment, or in SMTP headers, up to the limits of tolerance of whatever system you’re sending them to.)

    That said, if you do have a separate designer writing pretty HTML documents and another person writing the application to which they post, there are any number of ad-hoc ways to collaborate. Personally, I’ve generally used Perl’s POD or Javadoc (or whatever the appropriate/analogous inline documentation tool is for your language) to document accepted parameters and limits, and made those available to the art department (or whomever) as nice HTML pages they can pretend to read.

    If you were, rather, meaning the SQL table columns, there are any number of tools that will generate fairly decent documentation directly from the SQL server, from SHOW CREATE TABLE foo upwards… The SQL DDL is, itself, a schema on the order of XSD.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote simple update/insert statements that are returning a syntax error, what am I
I wrote a very simple web form that allows my user to view text
I wrote a very simple web form that allows my user to view text
I wrote a simple tool to generate a DBUnit XML dataset using queries that
I wrote a simple Sinatra app that generate an image using rmagick from some
Im new on Dxpreince 10.(and don't think im expert on this) I wrote simple
I wrote a simple opengl application in C which plots sin(x). This is my
I wrote simple application that using the cell phone camera. When i trying to
For get device id in android sdk i wrote simple This code :: import
is possible this wrote simple, code is here: foreach (var friend in friends) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.