#45331 - 2003-09-08 10:41 AM
Re: kix and html
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
If you are running KiXtart as a CGI under IIS then the web server must conform to the CGI protocol, which include passing the parameters to the executing program via environment variables.
I have Apache installed on my machine with KiXtart configured as a CGI.
Here is the script:
$gNULL=SetOption("ASCII","ON") $gNULL=RedirectOutput(%TEMP%+"\"+%REMOTE_ADDR%+"_"+%REMOTE_PORT%+".txt",1) $sTempFile=%TEMP%+"\cmd_output.txt" "Content-Type: text/html" ? ? "<"+"HTML>" "<"+"HEAD>" "<TITLE>KiXtart as CGI demonstration</TITLE>" "</"+"HEAD>" "<"+"BODY>" "Using KiXtart version "+@KIX+" as CGI!<BR>" "<HR>" "The following environment variables are set:" Shell "%COMSPEC% /C SET >"+$sTempFile "<PRE>" Display $sTempFile "</PRE>" Del $sTempFile "<"+"/BODY>" "<"+"/HTML>" Exit 99
|
If I call the script with this URL:
quote: http://localhost:8080/kixdemo.kix?myparameter
I get the following: quote: Using KiXtart version 4.20 as CGI!
-------------------------------------------------------------------------------- PROMPT=$P$G REDIRECT_STATUS=200 HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* HTTP_ACCEPT_LANGUAGE=en-gb HTTP_ACCEPT_ENCODING=gzip, deflate HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) HTTP_HOST=localhost:8080 HTTP_CONNECTION=Keep-Alive PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;;C:\MinGW\bin;C:\Program Files\Compaq\Compaq Management Agents\Dmi\Win32\Bin;C:\Program Files\Symantec\pcAnywhere\ SystemRoot=C:\Windows COMSPEC=C:\Windows\system32\cmd.exe PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH WINDIR=C:\Windows SERVER_SIGNATURE= Apache/2.0.47 (Win32) Server at localhost Port 8080
SERVER_SOFTWARE=Apache/2.0.47 (Win32) SERVER_NAME=localhost SERVER_ADDR=127.0.0.1 SERVER_PORT=8080 REMOTE_ADDR=127.0.0.1 DOCUMENT_ROOT=C:/Program Files/Apache Group/Apache2/htdocs SERVER_ADMIN=rhowarth@sgb.co.uk SCRIPT_FILENAME=C:/Program Files/Apache Group/Apache2/cgi-bin/exec_kix.bat REMOTE_PORT=1939 REDIRECT_QUERY_STRING=myparameter REDIRECT_URL=/kixdemo.kix GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 REQUEST_METHOD=GET QUERY_STRING=myparameter REQUEST_URI=/kixdemo.kix?myparameter SCRIPT_NAME=/cgi-bin/exec_kix.bat PATH_INFO=/kixdemo.kix PATH_TRANSLATED=C:\Program Files\Apache Group\Apache2\htdocs\kixdemo.kix
Note the values of REQUEST_URI and QUERY_STRING. [ 08. September 2003, 11:03: Message edited by: Richard H. ]
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 988 anonymous users online.
|
|
|