How to submit HTML form to exe app?

I'm just wondering how a website publishes information to an exe and how this exe grabs that information and outputs it using an html template file.

The code on the web page looks something like this:

<FORM ACTION="scripts/fetch.exe" METHOD=POST NAME=somename> 
<INPUT TYPE=TEXT NAME="id" WIDTH=30>
<INPUT TYPE=SUBMIT NAME="nothing" VALUE="Submit">
</FORM>

      

How does the exe get this "id"?

Edit: to be more specific:

after this exe (which I have source if needed) is called it looks for a user in the directory based on that id and then prints out information about users based on the template file. I know what he does with the information, I just don't understand how she gets this information.

0


a source to share


5 answers


This is a CGI application. When launched, the web server will execute the program and provide data via environment variables and STDIN.

In this example the POST form is read from STDIN in the form



id=30&nothing=Submit

      

+1


a source


This form uses CGI

In short, most CGI programs have a library that helps the programmer easily access form parameters. At this point, the program can process the data in several ways (database search, calculations, etc.) and generate content (html, javascript, etc.) to return the page. CGI was widespread before web servers were well integrated with application servers and interpreters like they are today.



Without the source (or disassembly) of this executable, you won't be able to know the details of what it does.

+2


a source


Why are you so sure that exe is actually an .exe application? You can match file extensions to whatever you like. I really like to mask my PHP pages as JSP.

0


a source


Web servers typically pass such requests to external handlers through the Common Gateway Interface .

0


a source


If you have an executable that you need to execute from a form, try setting up a website script that will grab the parameter and execute the command for you, rather than submitting directly to the .exe.

0


a source







All Articles