Click to See Complete Forum and Search --> : Program remote control
Biancazzurri
July 13th, 2007, 02:36 PM
Hi. I have a question.
I have some project to do.
Web interface with search field and button. On pressing the search button the web interface needs to, lets say invoke search in emule, and display the results. How do i do this action?
I have searched the internet for some answers, tried to break the "Emule code" because the webserver is coded there, but no results/
any ideas?
PeejAvery
July 13th, 2007, 02:47 PM
You mean you are trying to create online search access to a peer-to-peer network? That can't be done.
Biancazzurri
July 13th, 2007, 02:57 PM
No.
I wrote emule as an example.
i have program that does a search, now i need to make internet interface to search in return the results.
PeejAvery
July 13th, 2007, 03:00 PM
Well, how are the results stored? Database? Textfile?
Either way, you will need a server-side language to make it web-based. If you are running Apache, then you will want PHP. If you are using Microsoft IIS, you will need ASP.NET.
Biancazzurri
July 13th, 2007, 03:24 PM
language is really not a problem, i just don't have any idea how to interface the program which runs on server side with php lets say. How to "push" the search button using code.
the result is not stored, its displayed on result field
PeejAvery
July 13th, 2007, 03:33 PM
language is really not a problem, i just don't have any idea how to interface the program which runs on server side with php lets say. How to "push" the search button using code.
Well, if you are looking for someone to write you a program, that is less common here at CodeGuru. We do our best to help, but we don't have the time to write whole programs.
The easiest way to process a web form (in my opinion) is using PHP. Take a look at this (http://www.google.com/search?hl=en&safe=off&q=php+process+form&btnG=Search) Google search. It should help you out greatly.
the result is not stored, its displayed on result field
I mean, how is this web application going to search? Will it read from a database? Or from a textfile?
Biancazzurri
July 13th, 2007, 03:42 PM
You don't get me.
I don't seek for a programmer, programming side is not a problem for me.
The web interface only delivers the data to search from the internet user to the server. On server side the data need to be processed by a program thats is running there and return the answer to web.
My proble is the very transaction between php and the running program.
Maybe i'm not in the right forum - because now you say its php.
PeejAvery
July 13th, 2007, 03:58 PM
No. I am not saying that you must use PHP. All I am saying is that you keep mentioning needing to create a "web interface." The only way that you could get a "web interface" to communicate with another application is to have a server-side language helping you out.
The web interface only delivers the data to search from the internet user to the server. On server side the data need to be processed by a program thats is running there and return the answer to web.
Of course! That is how web applications work. I was under the impression that you already had something in the works and just needed a web client for it.
Biancazzurri
July 13th, 2007, 04:07 PM
so you understood right :)
PeejAvery
July 13th, 2007, 04:12 PM
So then, what exactly is it that you have done? In what language did you write it? This will help to know how to interact with it.
Biancazzurri
July 14th, 2007, 03:02 AM
c++
single form program
PeejAvery
July 14th, 2007, 08:54 AM
So how does this receive its input? Command line?
Biancazzurri
July 14th, 2007, 10:41 AM
Nothing, only search field
PeejAvery
July 14th, 2007, 11:11 AM
You're not understanding me...In order for one application to communicate with another (ie. web interface with external program) the external program must receive commands somehow. How does your program receive input?
EDIT: Or are you saying that the only input is when a user physically types in a textbox?
JVene
July 14th, 2007, 11:37 AM
Reading between the lines.....:)
In all cases I know (and I've done this a few times, though it's not my main forte), web based transactions like this are all in the same 'design'.
The web client sends data in a request using POST or GET - some web button or script prepares it, requests a URL in which the data is encoded.
The server parses the URL string, firing some action which performs the query using the data from the URL string.
If C++ does it, it uses the CGI standard. Text comes into a C++ program like a command line argument, output is sent from the program like a std out print.
It's the same for PHP - the mechanics of how the server launches a PHP script vs some CGI program generated in C++ differ, but the notion is the same.
It sounds like you have a C++ program with a search BUTTON that fires a search request, and that doesn't work.
You have to construct the C++ program in such a way that you could perform the search as if 'from the command line' - taking text as input, providing text (probably formatted HTML, like PHP typically does) as output.
Biancazzurri
July 15th, 2007, 02:17 AM
The only input is physical typing peej.
I cant write a command line program because this program is closed - no code only exe.
My idea:
Each time web user makes a search - search text is written in the database.
Write a program that checks the database. if there are any lines - make a search.
JVene
July 15th, 2007, 03:53 AM
If it's a windows program and you can't recreate it's search then what you can try is to hunt down the window handle to the controls and send them messages to simulate keystrokes to simulate keyboard entry of the query, then get the handle to the result window and get the text.
You'll have to serialize the requests though, unless you can run multiple instances of the query program.
PeejAvery
July 15th, 2007, 09:26 AM
Using JVene's idea would require ASP.NET because you won't be able to work with window handles using PHP, JSP, etc. as your server-side languages.
JVene
July 15th, 2007, 01:21 PM
True, that idea can't work with any language that's incapable of getting a window handle, but I think CGI could do it with a C++ application, where the C++ application is built as a console app with MFC support (or something similar to get win32 in there).
It's a nasty bit of business, though. If your demand is high enough, this would end up being slow.
It also occurred to me that you should check to see if your target exe application has automation features, because you might do better to use automation if it's available.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.