Link to home
Start Free TrialLog in
Avatar of funkydude
funkydude

asked on

accepting post data in web executable

when building a web executable, how do you accept input? i understand it must be sent back to the web executable thru a form (POST), and i know how to cout >> to the browser and all ... but how do you tell the exe that this data here thats being slung at it, is the POST data?

is it the argc argv, command line arguments that will represent the POST data-incoming?

is the question clear or should i put down the b0ng and re-write my ?? ....

thanks-
f_dude
Avatar of imadjinn
imadjinn

The data into CGI actually gets sent through stdin (for post data), so you could read it from stdin using a file pointer or an istream (cin).  You could also wrap a socket around it and get it through recv, which I think is cleaner but actually takes a little more learning.  If you use argc and argv directly, you have a problem determining where the end of the post data is (since spaces can be intermixed with the rest of the data; and you wouldn't know how many spaces or if they're tabs or whatever).  Use cin.read().  Good luck.
Avatar of funkydude

ASKER

hi

thanks for the great reply ... ill throw an extra 50pts if you can point me to some sample code i can learn from, as a model/example.

thank you again-
f_dude
ASKER CERTIFIED SOLUTION
Avatar of imadjinn
imadjinn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
its a great thing when someone helps you learn a new 'thing... greatly appreciated!

f_dude