Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Remote program control (http://www.programmingforums.org/showthread.php?t=13555)

narrowdoctor Jul 14th, 2007 6:43 AM

Remote program control
 
Hi

I have some project to do.
There is a program which runs on server side. The program does some search functions.

I want to build web interface in order for web users input the search data on the site and when they press search the web interface interacts with the program on server side - copies the search text and "presses the search button" in the program.

I just really don't know if it can be done.. Could you help me?

DaWei Jul 14th, 2007 7:29 AM

Sounds like Google, doesn't it? Just have the search data submitted and pick it up on the server through the post variables. Respond with the results.

narrowdoctor Jul 14th, 2007 7:35 AM

thats right, i just don't have any idea how to copy the data to search field and press the button int the program which runs on server

francoissoft Jul 14th, 2007 7:46 AM

PHP already runs on the server. It just takes in and spits out data to the client.

DaWei Jul 14th, 2007 8:07 AM

You need to learn about the client/server paradigm, using http. Include the PHP manual in your list of resources.

narrowdoctor Jul 14th, 2007 10:42 AM

lets do it simplier
i need each time when web user presses the button, the button in the program (exe program) on server side will be pressed. could that be done?

DaWei Jul 14th, 2007 12:14 PM

The answers couldn't be any simpler than they've been. All you have to do is learn how the client and the server interact. It's done on zillions of web pages all the time. Look at the top of this page. See that search box up there?

narrowdoctor Jul 15th, 2007 2:19 AM

i know what is client server interaction
you dont understand that the problem is on server side? no between client and server

xavier Jul 15th, 2007 2:29 AM

Hi,

From php, i don't think you'll be able to that. You won't be able to "press the button" on the application on the server

Dameon Jul 15th, 2007 3:35 PM

It is possible. It will just be ugly. I'm not aware of any GUI automation libraries for PHP.

I'll assume for now that you are using Windows. Perhaps you could write an AutoIt script to perform the text pasting and button clicking...a quick search gave me this page, which demonstrates how to run a script from the command line as well as retrieve parameters (such as the search text to paste in). Alternatively, it seems you could access it via COM, starting with a line like
:

$autoit = new COM("AutoItX3.Control");
I forsee one problem, however. Services, such as your webserver and the scripts that run under it, will run under a different "window station" (collection of desktops) than the default interactive one for security reasons. If the application that you are trying to automate is launched by the webserver, it will be in the proper window station to begin with. If for some reason you intend to leave it running on some other user account all the time...which would be even more of a dirty hack than we're already talking about...then you'll have a lot more work to do, as autoit would not be able to touch it.

On OS X, you might use AppleScript (if the app supports it).

Not too sure about other platforms.


All times are GMT -5. The time now is 11:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC