Shoutbox

Run a script from PHP - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Run a script from PHP (/showthread.php?tid=68183)

Run a script from PHP by Eagle_Erwin on 11-08-2006 at 11:43 AM

In my student house, I have a webserver with PHP and I use Messenger Live with Plus!. I have written some scripts, and it all works very well. But in some cases, I want to run a script from a PHP script.

For example: I have a webcam on my site. When somebody clicks on the webcam-link I want to get a message from WLM that says who is watching. Now it works by editing the Plus! script, so it restarts itself.

Is it possible to do it in another way? It will give my sites much more features: an input-field where you can type text, and a button. When you press the button, a Plus! script will send that message to my WLM account. So everybody can talk to me via WLM, without having WLM or having me in their contact list.


RE: Run a script from PHP by Ezra on 11-08-2006 at 11:54 AM

I suggest you read this.

http://nl2.php.net/manual/en/ref.w32api.php


RE: Run a script from PHP by Eagle_Erwin on 11-08-2006 at 01:07 PM

Thanks for your fast reply. But is seems that the w32api only works for PHP 4.x.x. I'm using PHP 5.2.0. I saw something about the ffi extension, but it's not compatible since PHP 5.1.0.

Any other options?


RE: Run a script from PHP by hmaster on 11-08-2006 at 04:29 PM

quote:
Originally posted by Eagle_Erwin
Is it possible to do it in another way? It will give my sites much more features: an input-field where you can type text, and a button. When you press the button, a Plus! script will send that message to my WLM account. So everybody can talk to me via WLM, without having WLM or having me in their contact list.
You can have the "messages" saved to a file. Then download the file to read through your plus script. And it can have a reply which will send a reply message to that person who can reply back through the page on your website.

RE: RE: Run a script from PHP by Eagle_Erwin on 11-08-2006 at 04:39 PM

quote:
Originally posted by hmaster
quote:
Originally posted by Eagle_Erwin
Is it possible to do it in another way? It will give my sites much more features: an input-field where you can type text, and a button. When you press the button, a Plus! script will send that message to my WLM account. So everybody can talk to me via WLM, without having WLM or having me in their contact list.
You can have the "messages" saved to a file. Then download the file to read through your plus script. And it can have a reply which will send a reply message to that person who can reply back through the page on your website.



Ok, sounds like a good option, but how does the WLM script know that the file is modified, and that the text in it has to be send to a person via WLM?
RE: Run a script from PHP by hmaster on 11-08-2006 at 04:41 PM

quote:
Originally posted by Eagle_Erwin
Ok, sounds like a good option, but how does the WLM script know that the file is modified, and that the text in it has to be send to a person via WLM?
You would have to start a timer to check the file every x amount of seconds/minutes. The text could only be sent if the person is on your allow list otherwise it won't be able to send.

RE: RE: Run a script from PHP by Eagle_Erwin on 11-08-2006 at 04:57 PM

quote:
Originally posted by hmaster
quote:
Originally posted by Eagle_Erwin
Ok, sounds like a good option, but how does the WLM script know that the file is modified, and that the text in it has to be send to a person via WLM?
You would have to start a timer to check the file every x amount of seconds/minutes. The text could only be sent if the person is on your allow list otherwise it won't be able to send.



I'm afraight a timer would use a big amount of system resources, when it have to check a file every 5 sec.

I was more looking for a command-line thing or maybe an API, as Ezra posted. The problem is, I know nothing about API's, and it looks pretty hard for me.
RE: Run a script from PHP by Ezra on 11-08-2006 at 05:45 PM

Maybe make an external exe that gets started by php, exec still works on PHP 5.


RE: Run a script from PHP by hmaster on 11-08-2006 at 06:01 PM

quote:
Originally posted by Eagle_Erwin
I'm afraight a timer would use a big amount of system resources, when it have to check a file every 5 sec.
I dont think so it doesnt take that much resources. Try it and you'll see.