Solved

A Easy Question From a Beginer

Posted on 1998-05-18
6
169 Views
Last Modified: 2013-12-25
This is my first time in CGI, i need to develop a app that stores the fields of a form in a file in the server

I'm thinking in using C/C++, i've been told that CGI is about parsing the parameter passed to the application!

If this is true, i can build a dos based C/C++ app that will parse the argv parameter and write the values to a file, is that rith??

If that's ok, i need to know how are the values of the form fields passed to the app, and how can i give the user a response??

please if you can do provied me with c/c++ examples!
0
Comment
Question by:PedroMVGomes
[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
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
ShadowSpawn earned 70 total points
ID: 1828835
First Question is what kind of server you're running on.  But, regardless of that you can find a good generic C library for handling all the parsing / decoding at http://www.boutell.com/cgic/ .  After you've read the form input, saved  it or whatever you simply return a stock webpage to the user by using the Location HTTP header or using a
printf("Content-type:text/html\n\n";
printf("Whatever<br>\n");


Enjoy

0
 
LVL 2

Expert Comment

by:tpryor
ID: 1828836
perl is so easy for parsing text. I'd say it is the only way to go.
or you can use perl in your c code.
check out www.cpan.com

t
0
 

Expert Comment

by:ShadowSpawn
ID: 1828837
PERL is nice, but a compiled C script is at least twice as fast and your source code is protected.
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 2

Expert Comment

by:tpryor
ID: 1828838
as far as speed goes, you only get the hit for compilation after that it is on par with c, and with isapi and such your perl code only compiles once then runs in memory on any other calls to your code, your perl code is also protected, remember it gets executed not sent to the browser.

typicaly the form info is so small it is like using a hammer to kill a fly if you write such a think in c, anyway c is way too clumsy when it comes to text.

IMHO
t

0
 

Expert Comment

by:ShadowSpawn
ID: 1828839
Average Run Time for a comparable compiled CGI will always we faster than an interpreted script. No arguements allowed.  As far as protection goes, I'm refering to protecting your code from theft / alteration by others --- either client , host or what have you.  But Yes --- if all you need is a basic form response then perl is much easier.  But if you are even a descent C programmer, you can do just about anything you want with CGI's in C/C++.
0
 
LVL 2

Expert Comment

by:tpryor
ID: 1828840
not saying you couldnt, just that...

1) easier (typically one paragraph, c 3pg)
2) compiled (speed)
3) not clumsy (text)

nothing is 100% safe from theft on computers. and have you heard of decompilers.

You know c is great for large scale apps but ypically when working with forms or internet apps it is really over kill.  We arent building some realtime 3d graphics engine, thats when c shines.  However you could allways beat it with assembly. <gr>

BTW. you can embed perl in c.
best of both worlds.

IMHO
t
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Is it possible to create a playfile with setacl or icacle? 3 63
Adding a countdown to HTA 12 116
Find unused columns in a table 12 97
add if statement powershell 8 58
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…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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…
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…

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