Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

forms and passing variable to my program

Posted on 2000-04-22
8
Medium Priority
?
173 Views
Last Modified: 2013-12-25
Hi. I am trying to develop a CGI application in C++. The info on CGI in C++ that I have found is very limited. So I am basically trying to understand it from CGI with Perl. I got a few questions regarding this form I have made and the program I am developing.
tHis is the form:
<html>

      <head>
            <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
            <meta name="generator" content="Microsoft FrontPage 4.0">
            <title>Search Engine</title>
      </head>

      <body>
            <input src="(Empty Reference!)" type="image">
            <p><input type="text" name="textfieldName" size="24"> <input type="submit" name="submitButtonName"></p>
            <p><input type="checkbox" value="checkboxValue" name="checkboxName">By Name</p>
            <p><input type="checkbox" value="checkboxValue" name="checkboxName">By Location
      </body>

</html>

Questions:

1. How do I use that form with my C++ program?
2. How in my program I would receive the data entered in the form. For example, if the person enters United States, how do I passed this value to my program?

0
Comment
Question by:bea_pr
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:lambda
ID: 2740218
You don't have a form tag in the code... Use the form action as the name of the cgi pgm u want to call.

<html>
                    <head>
                    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
                    <meta name="generator" content="Microsoft FrontPage 4.0">
                    <title>Search Engine</title>
                    </head>

                    <body>
                    <form action="/cgi-bin/mypgm.cgi" method="post">
                    <input src="(Empty Reference!)" type="image">
                    <p><input type="text" name="textfieldName" size="24"> <input type="submit"
                    name="submitButtonName"></p>
                    <p><input type="checkbox" value="checkboxValue" name="checkboxName">By Name</p>
                    <p><input type="checkbox" value="checkboxValue" name="checkboxName">By Location
                    </form>
                    </body>

                    </html>

£.
0
 
LVL 23

Accepted Solution

by:
chensu earned 240 total points
ID: 2740427
There are a lot of CGI libraries to help you do it. They come with samples and tutorials. For example,

GNU Cgicc
http://www.gnu.org/software/cgicc/cgicc.html

cgiClass
ftp://www.math.unh.edu/pub/black/cgiClass
0
 
LVL 23

Expert Comment

by:chensu
ID: 2740430
Tips, instructions and tutorials on programming CGI in C and C++
http://cgi.resourceindex.com/Documentation/Programming_in_C_and_C++/
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

Author Comment

by:bea_pr
ID: 2740642
I got the cgicc library, but I haven't been able to figure how to make it work with my program.
0
 

Author Comment

by:bea_pr
ID: 2740670
do you know how it works?
0
 

Author Comment

by:bea_pr
ID: 2740672
If so can you explain?
0
 
LVL 23

Expert Comment

by:chensu
ID: 2740750
I would suggest you take a look at the tutorials first.

http://cgi.resourceindex.com/Documentation/Programming_in_C_and_C++/

Cgicc's documentation is at

http://www.gnu.org/software/cgicc/cgicc-doc.html

There is a tutorial as well.
0
 

Author Comment

by:bea_pr
ID: 2741106
I'll look at them
thanx
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question