Advertisement Jump to content


This topic is now archived and is closed to further replies.


Another php and c++ working together

This topic is 5829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post

Link to post
Share on other sites
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)

Share this post

Link to post
Share on other sites
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 ...

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!