Another php and c++ working together

Started by
2 comments, last by iamwithstupid 21 years, 2 months ago
I have a program that opens the default browser to my website to a certain page, is there a way for my program to recieve feedback directly from my php script. Basic example: Open my program, which opens the default browser and then points it to my page. I type in my name and submit the form. Is it then possible for my c++ program to recieve information back from the php script, say to store the name in an array? thanks in advance jack [edited by - iamwithstupid on January 31, 2003 2:17:40 PM]
Advertisement
I''m absolutely inexperienced in this, but as I understand it, you''d have to make your program do the HTTP''ing. So your program wouldn''t open the browser (because it couldn''t get any info from it), but request the PHP page itself, and send your name and everything. Then it could read the PHP "response" page.

"George W. Bush Geography Simplification Initiative"

More info on George W. Bush
My Homepage (C++ SDL OpenGL Game Programming)
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
Sounds good!

Anyone know any articles or tutorials on this topic?

thanks in advance
jack
Well ... one trick you can easily use, since these types of features are consdered part of the base package of scripting languages - and therefore free ... you can pick your favororite embedable scripting language (PERL, php, python, or my favorite - ruby). Then embed the interpreter into your C/C++ program, which gives your C++ program the ability use the scripting language functions (exact method and behavior varies by language). Then use the scripting languages HTTP features to get the results from your website.

Of course the only reason I even mention the scripting language is because finding a cheap and good C/C++ library for a specific task is a decent amount of work ... so for the things which are not built into C++ (or present in the boost library), but are present in EVERY scripting language ... you might as well save yourself the trouble of doing any research ...

Someday down the line, when the game or whatever goes to production stages, you will probably replace those scripting language calls with a native C/C++ library for efficiency reasons - but only after your program works, you are ready to distribute it / make money, and you have profiled it enough to know that improving the scripting speed would actually help your game enough to matter (sometimes it won''t be needed at all).

Good luck .. hope this gives you a new way to think about old problems ...

ALSO - almost all HTTP libraries .. including the scripting language ones, just read the response of the page request into a file or stream buffer ... so you then manipulate it just like you we''re dealing with a web page on your local computer ...

This topic is closed to new replies.

Advertisement