Solved

forms and passing variable to my program

Posted on 2000-04-22
8
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 80 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to count occurrences of each item in an array.

752 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