Getting form data from a CGI script written i C++

What is the easiest way to get form data from a cgi script written in c++ (VC5.0), i would like to create a function that i could call like this GetFormData(formfieldname) and it would return the value for the formfieldname(it doesn't matter whether its post or get). It is very easy in Visual Basic, but i am new to c++ and would really like some help with the aid of some source code or a hint to what i should do.
thomasschmidtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

julio011597Commented:
Would you accept a C function?
0
thomasschmidtAuthor Commented:
Yes please, and thank you very much!
Thomas
0
df020797Commented:
Data from a form is sent in this form:
var1=value1&var2=value2&var3=value3&...&varn=valuen
where varx is the names fields in the form and the valuex is the values typed into the form from the browser.

This data is transfered in two ways.

If the method=GET its stored in the enviroment variable QUERY_STRING and if the method=post its sent via stdin

0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

thomasschmidtAuthor Commented:
I am using the get method. I was wondering what the easiest method to "dekode" the QUERY_STRING is, so i could use a function to call with the var and get the value back, it is just because i am a lousy c++ programmer i have done the same in the Visual Basic and its not so difficult.
0
julio011597Commented:
BTW, if you are satisfied with my code, would you mind letting me post it as an answer?
0
julio011597Commented:
To df:

yours is not an answer, so why did not you just post a comment??
0
julio011597Commented:
Thank you Julio, nut how do i give you the points, I am only allowed to give the points to DF (no offense)??????
0
thomasschmidtAuthor Commented:
You just reject his answer, so i'll be able to submit mine as the answer.
0
julio011597Commented:
Mineis also an answer... I just didnt enter code... I told him hwo it works... much better than just copying someones code and dotn usertsand what it does...

0
df020797Commented:
Thanks.

The code works well and _fast_ as is.

Just get rid of that '{' at the line:

"if(*curs == '=') {"

Regards.

0
julio011597Commented:
df:

The question was:

"i would like to create a function that i could call like this GetFormData(formfieldname) and it would return the value for the formfieldname..."

Do you really think your was an answer?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.