CGI program help please
I'm having a hard time trying to figure out how to implement this.
Develop a program written in C that will handle encoding and decoding of
* Your program should run from a command-line interface in Linux (preferably)
or DOS. It should prompt the user to enter these items:
3. Phone number
* Once you collect this data, CGI encode it and display the encoded string.
* Decode the CGI data, and display a label and associated value (these should
match exactly what the user entered.)
* Do not link in or use any code except what can be found in the standard
Now I can set up and make a program that will fulfill the data requirements with executable that a user runs, though I'm not sure how to convert it to CGI and display it from there. I can also make the CGI script so that if the user goes to a webpage, puts in the information in the requirements will be fulfilled. My problem is how do I encode and decode data as CGI from a command line or shell, and how can data from an executable be made into CGI data. Thanks.
So have you read any pages on the web as to how CGI works ?
I've read quite a bit of information on CGI encoding, and how it works. A quick run-down from what I've learned.
A CGI is a program that automatically runs when a user goes to a website address, or clicks a link to run the program such as something that says "click here to see the current time". The server then executes the CGI program, and the results are displayed on the user's web browser.
My problem is understanding how a program is suppose to executed on a command line, if it is run exclusively server-side, with results in a web browser. (how I even open a web browser from a command line is something I've not been able to determine).
I posted the same question on another website, and a post someone made made me think about the problem a bit differently. I think the problem is that I'm not suppose to create a CGI script, but rather use URL encoding and decoding methods to take care of the data that the user inputs. Does this sound more reasonable?
Yes, it seems to me like it's just an exercise in encoding and decoding a CGI request. I don't think you need to actually send it to a remote server or anything.