Hi Alexandar. won't emscripten_async_wget serve your needs? it sends requests to server and params can adjast which type of request is sent.
Regards Sergey On Thu, Nov 13, 2014 at 11:58 AM, Aleksandar Stančić <[email protected]> wrote: > Hi! I'm writing a game in C++/OGL (to be published on the web through > Emscripten) that needs some interaction with a server, written in > PHP/MySQL. I already prepared the database and PHP code, and now, the > surprisingly difficult part is connecting the two. Is there a simple way of > loading a web page with a few POST strings in C++/Emscripten? Two-to-three > strings go in (POST) and I need to read one string or integer on the output > (HTTP response). emscripten_wget just hangs on me, and mixing JS + C++ > seems to be able to transfer only numbers (ASM). Can someone point me in > the right direction? I feel like I'm missing something obvious, and I > wouldn't really know, since I'm not much of a web developer. Thanks. > > Just to clarify, I have a PHP page like this: > > $a = $_POST['a'] // a and b need to come from C++ > $b = $_POST['b'] > > > > // do stuff with $a & $b > > > echo($c) // a string, under 100 regular ASCII chars, nothing special > > So, I need to do a HTTP POST request (I can switch to GET if that'll make > things easier), and read a single line of text back into C++. What would > be a good way of doing that? I hate to be *that guy**,* but it is kind > urgent (I really wrote myself into a corner with this one, I expected this > to be easy), so any tips are greatly appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
