hackalive Posted January 1, 2012 Share Posted January 1, 2012 Hi guys, I am after some code (PHP/AJAX/jQuery) that will let me send a command to a AJAX listener on another pc (or even eventually browser window), a bit like doing remote command/control. I thought about how does IM services do it and after research found they are dependent on a file or a db, any way to not be dependent on those? Or do I need to be? Furthermore if I do, anyone have a clean example (even a step by step tutorial) of an IM code with AJAX listener etc that I can use as an example and guide to modify into what I need? All help is greatly appreciated. Hope you all had a good NYE _ Cheers Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/ Share on other sites More sharing options...
trq Posted January 1, 2012 Share Posted January 1, 2012 Ajax is simply a http request. You can use curl to make a http request. Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303007 Share on other sites More sharing options...
hackalive Posted January 1, 2012 Author Share Posted January 1, 2012 @thorpe, Thanks for the advice ... but how to execute it (as in make it work). PS I am generating a "GUID" for each device, so this would replace the login you would use in a normal IM script. The GUI is set as a PHP cookie and also stored in a DB. Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303010 Share on other sites More sharing options...
trq Posted January 1, 2012 Share Posted January 1, 2012 It is really not at all clear what your trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303014 Share on other sites More sharing options...
hackalive Posted January 1, 2012 Author Share Posted January 1, 2012 @thorpe, Reflecting I can see that its not all that clear. I'll lay it out step by step ================================ 1. http://mydomain.com/ is open on PC1 and PC2 2. Same use (demo) has logged on on both PCs 3. PC1 and PC2 are allocated a "GUID" stored in $_COOKIE['guid'] and in DB. This GUID acts as the identifier of each device. You will see the purpose of this in a minute. 4. on PC1 I press a button "make PC2 blue" When I do this it should send a command to the AJAX listner on PC2 from PC1. The listner disects the command and then acts on it The only part i need help on is making the listner and sending commands to it. ================================= Does this make things clearer? or not? Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303017 Share on other sites More sharing options...
trq Posted January 1, 2012 Share Posted January 1, 2012 The best you could do would be to have the command sent to the server and stored. You could then have the other pc poll the server for any new commands. Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303018 Share on other sites More sharing options...
hackalive Posted January 1, 2012 Author Share Posted January 1, 2012 Yeah so store in a DB and replicate the AJAX calls the IM stuff usually does Quote Link to comment https://forums.phpfreaks.com/topic/254159-remote-call-send/#findComment-1303019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.