Does anyone know how to get the Enviroment
Variables so one can know if it's null,( and

might be cool to print them tOo!)
So you can know when to bypass calling StdIn
because if there's no data, the CGI just

stalls and times out,

It really revolves something like around
pQuery = getenv("QUERY_STRING");

if (pQuery != NULL)

I'm using POST though instead of QUERY_STRING, though

Basically so I don't need a seperate html
page for data entry


Here's what I did in a C cgi

CGI

http://www.busybeesolutions.com/cgi-bin/intro/

einstein.exe

Source

http://www.busybeesolutions.com/sourcefiles/ei

nstein.htm

Thank Andy

:stupid:
Posted on 2001-11-20 09:37:18 by andy981
Posted on 2001-11-20 09:39:34 by andy981
There is the GetEnvironmentVariable API, but I'm not sure if its what you want.....

Mirno
Posted on 2001-11-20 09:56:48 by Mirno
invoke GetEnvironmentVariable,ADDR Buffer2,(LENGTHOF
Buffer2 - 1)

This did not work?
But I'm just guessing
Posted on 2001-11-20 10:10:15 by andy981
This code worked for me:



.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib


.data
env db "PATH",0
buffer db 2048 dup (0)

.code
start:
invoke GetEnvironmentVariable, ADDR env, ADDR buffer, 2048
invoke MessageBox, NULL, ADDR buffer, NULL, MB_OK

invoke ExitProcess, eax
end start


Mirno
Posted on 2001-11-20 10:37:30 by Mirno
I wrote an example that answers all your questions. Put test.html and cgitest.exe in the same folder and open test.html. The rest speaks for itself.

Thomas
Posted on 2001-11-20 14:26:56 by Thomas
This is Great, now I can have the post html in the exe it self,
I had to go out earlier, but It had dawned on to me that
Mirno had an idea, I mean Instead of "path" for the string
in variable use "Request Method".

Hopefuly in Time I can build a universal way to get data in,
for CGI's at the moment, I'm just considering numbers in.
But, I was thinking have an array with the addresses of
seperate empty strings, then load the contents of each
field, to be manipulated as needed, In the seperate string variables.
Anyway THanks Thomas, Your definately a Wizard

Andy

:)
Posted on 2001-11-20 15:19:31 by andy981
I'm dumb-founded. I guess I should write a FAsm to MASM32 converter.
Posted on 2001-11-20 15:43:34 by eet_1024