Run a script from PHP |
Author: |
Message: |
Eagle_Erwin
Junior Member
Eagle Erwin
Posts: 17 Reputation: 1
38 / / –
Joined: Aug 2006
|
O.P. Run a script from PHP
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.
|
|
11-08-2006 11:43 AM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: Run a script from PHP
|
|
11-08-2006 11:54 AM |
|
|
Eagle_Erwin
Junior Member
Eagle Erwin
Posts: 17 Reputation: 1
38 / / –
Joined: Aug 2006
|
O.P. RE: Run a script from PHP
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?
|
|
11-08-2006 01:07 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: Run a script from PHP
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.
|
|
11-08-2006 04:29 PM |
|
|
Eagle_Erwin
Junior Member
Eagle Erwin
Posts: 17 Reputation: 1
38 / / –
Joined: Aug 2006
|
O.P. RE: RE: Run a script from PHP
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?
|
|
11-08-2006 04:39 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: Run a script from PHP
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.
|
|
11-08-2006 04:41 PM |
|
|
Eagle_Erwin
Junior Member
Eagle Erwin
Posts: 17 Reputation: 1
38 / / –
Joined: Aug 2006
|
O.P. RE: RE: Run a script from PHP
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.
|
|
11-08-2006 04:57 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: Run a script from PHP
Maybe make an external exe that gets started by php, exec still works on PHP 5.
|
|
11-08-2006 05:45 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: Run a script from PHP
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.
|
|
11-08-2006 06:01 PM |
|
|
|