Here's the deal:
I have PHP 4.2.3 running on Win2k SP3. I have a program running in the background, aside from the server. This program, like any other win32 program, can receive messages via SendMessage. When it receives a specific message, it is supposed to carry out a certain function. Here is the problem: There is no way to send a message to this window through PHP. I have tried using exec() and system() in PHP to execute a separate program to send the message to the other window. In order for this program to send the other window a message, it has to know its handle. Strangely, in PHP, this program CANNOT find the handle even though it DOES exist. When PHP uses the exec()/system() command, it runs the program as a thread under its own process, and the window, for some reason, cannot "see" the other windows running in Windows. So, I decided to use the w32api functions that came with PHP. I did a w32_register_function for SendMessage and FindWindow. I figured I'd use FindWindow to find my other window handle and then SendMessage to send the message. This did not work, either. Soooo, if you're still with me, how can I get PHP to send a message to another window running on the side?

    I dont think that sending any data to another window is PHP's business.May i remind you that PHP is a server side scripting language?

    It's obvious that that method wouldn't work out because of the basic rules of Protected Mode Computing.

    But it's not the only thing i'm going to say... Here what pops up in my mind when i read your thread..

    An ActiveX component can be prepared and embeded in HTML file. By rising events with ActiveX, you can even make it interract with JavaScript and dynamically add/delete/update the content of the main HTML web page by using DIV tags .innerHTML property.

    And at the back end, ActiveX can have a Peer2Peer connection to the massage handling software via socets which is located in the same computer or running remote.

    But here's what would happen if you use ActiveX solution...

    -Client browser downloads the HTML
    -ActiveX starts running, opens a socet to the server. listenes for a message to arrive
    -While this occurs client user has a static page...
    -When a message is recieved, Active X sets a Javascript variable with the info of newcoming message and then rises an event,
    and an even handler routine written with Javascript running at
    -Clients browser takes the new message and publishes it by setting document.getElementById('idOfBuffer').innerHTML property.
    -The backend is as a usual socket connecting software

      Write a Reply...