I use both SFML HTTP class and Microsoft WinHttp to do a request from a webserver and of course, the PHP code will execute in the server and my C++ code just gets the output. Don't know about javascript being involve here.
Try googling those two libraries. Good luck!
BTW, it would be nice if you explain more what are you trying to accomplish here.