Solved

forms and passing variable to my program

Posted on 2000-04-22
8
166 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
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.

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Bulk Reorder File Names 4 73
Quickest way to query Windows Event ID from a Linux Device 3 70
size of file 1 22
Powershell Split 18 29
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

763 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