| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Accepting commands from a web page.
Hey guys,
I need to have a C++ program accept and read commands thats being sent from a web site. Bascially I need the web page to send a command like, stop. And the C++ program would recieve that and stop what its doing, or start a program. The web page will be created in PHP. Any ideas? Thanks. Jim |
|
#2
|
|||
|
|||
|
This is fairly hacky and I'm sure there must be a better way but a quick nasty solution is to have a thread in the c++ program poll a given file and use the webpage to populate that file with command strings to execute.
-KM- |
|
#3
|
|||
|
|||
|
I need the web page to send a command and have the c++ program receive it and instantly start its processes. No middle man, per say. They need to speak directly with each other, and the commands need to be instant and secure.
Jim |
|
#4
|
||||
|
||||
|
I guess you could write the C++ app as an XML-RPC server and the Web page as an XML-RPC client.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#5
|
|||
|
|||
|
Where could I get some info on doing that? Also I've been looking around, and noticed PHP can send infomation to sockets. Now if I had a C++ listening for data coming in over a certain socket, could I have PHP sending that information? Do sockets work cross plateform like that? Thanks.
Jim |
|
#6
|
|||
|
|||
|
Will the c++ app be running on the same machine as the webserver?
-KM- |
|
#7
|
|||
|
|||
|
Quote:
No, thats why I was thinking of using something like sockets. Bascially I just need the two to communicate with each other, but the communication needs to be directly with each other. Not through a file, or something like that. Jim |
|
#8
|
|||
|
|||
|
In which case you'll definitely want to be writing some networking code for both the c++ app and php pages. For the c++ app consider using hawknl rather than just the sockets themselves since its an excellent wrapper (www.hawksoft.com/hawknl) but as for the php pages I don't know much about how it work.
-KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Accepting commands from a web page. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|