Solved

forms and passing variable to my program

Posted on 2000-04-22
8
169 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

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…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

626 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