| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| foobar -
 
 
 Joined: 29 Jun 2004
 Posts: 2
 
 
 | 
			
				|  Posted: Tue Jun 29, 2004 12:48 pm    Post subject: POST not working on CGI executable |   |  
				| 
 |  
				| I have a CGI executable, account.exe, enabled under Abyss, and it partially works. Calling up the program with say http://127.0.0.1/account.exe I get a Web form as I'm supposed to, but when I try to submit the form, no POST actually takes place, it just seems to do a GET. Same account.exe works under IIS and Apache. 
 Have "Resolve interpreter using the Windows Registry=Yes" and added the account.exe under CGI Paths, and all that seems fine--the program executes as opposed to trigger a browser download.
 
 What have I done wrong?
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| aprelium -
 
 
 Joined: 22 Mar 2002
 Posts: 6800
 
 
 | 
			
				|  Posted: Tue Jun 29, 2004 4:07 pm    Post subject: Re: POST not working on CGI executable |   |  
				| 
 |  
				| foobar, 
 All depends on the HTML code in the form you're using. The best to do is to send us a zipped package to support@aprelium.com containing your abyss.conf file, your CGI executable and HTML forms that use it.
 _________________
 Support Team
 Aprelium - http://www.aprelium.com
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		| foobar -
 
 
 Joined: 29 Jun 2004
 Posts: 2
 
 
 | 
			
				|  Posted: Tue Jun 29, 2004 7:21 pm    Post subject: |   |  
				| 
 |  
				| The HTML is alright, ie method="POST", so that's not it. The exact same executable works under IIS 5-6 and Apache 2.0.43. I'll zip things up and send you an email. |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| n1ist -
 
 
 Joined: 05 Aug 2004
 Posts: 4
 
 
 | 
			
				|  Posted: Sat Aug 07, 2004 1:35 am    Post subject: |   |  
				| 
 |  
				| I am seeing the same thing here.  The form definitely has method="POST", yet adding a system("set"); in my cgi executable shows
 REQUEST_METHOD=GET
 CONTENT_LENGTH=0
 
 Any ideas what to look for?
 Thanks.
 /mike
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| aprelium-beta -
 
 
 Joined: 24 Jun 2004
 Posts: 383
 
 
 | 
			
				|  Posted: Sat Aug 07, 2004 2:44 am    Post subject: |   |  
				| 
 |  
				|  	  | n1ist wrote: |  	  | I am seeing the same thing here.  The form definitely has method="POST", yet adding a system("set"); in my cgi executable shows
 REQUEST_METHOD=GET
 CONTENT_LENGTH=0
 
 Any ideas what to look for?
 Thanks.
 /mike
 | 
 Can you copy/paste here the <form ...> line from your HTML (or all your HTML source code if not too long) so that we can review it? FYI, Abyss doesn't change the request type. The request type is set by the browser, so this means that either your browser doesn't understand POST or that there a problem with your HTML form.
 _________________
 Beta Testing Team
 Aprelium - http://www.aprelium.com
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		| n1ist -
 
 
 Joined: 05 Aug 2004
 Posts: 4
 
 
 | 
			
				|  Posted: Sun Aug 08, 2004 4:18 pm    Post subject: |   |  
				| 
 |  
				| Here's the html: 
 <html><head><title>survey</title></head>
 <body>
 <form action="http://www.ardai.org/cgi-bin/barcsurvey.exe" method="POST">
 <input type="submit" value="Click Here to submit the survey">
 </form>
 </body></html>
 
 And here's the result of the system("set") in barcsurvey.exe:
 
 PROMPT=$P$G
 SystemRoot=C:\WINNT
 PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
 COMSPEC=C:\WINNT\system32\cmd.exe
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
 WINDIR=C:\WINNT
 TMP=C:\DOCUME~1\pc\LOCALS~1\Temp
 TEMP=C:\DOCUME~1\pc\LOCALS~1\Temp
 SERVER_SOFTWARE=Abyss/1.2.3.0-Win32 AbyssLib/1.1.0
 SERVER_NAME=ardai.dyndns.org
 SERVER_PROTOCOL=HTTP/1.1
 SERVER_PORT=80
 REMOTE_ADDR=192.168.1.1
 REMOTE_PORT=17160
 GATEWAY_INTERFACE=CGI/1.1
 DOCUMENT_ROOT=C:\program files\abyss web server\htdocs
 REQUEST_URI=/cgi-bin/barcsurvey.exe
 SCRIPT_NAME=/cgi-bin/barcsurvey.exe
 SCRIPT_FILENAME=C:\program files\abyss web server\cgi-bin\barcsurvey.exe
 REQUEST_METHOD=GET
 CONTENT_LENGTH=0
 REMOTE_USER=
 HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
 HTTP_REFERER=http://ardai.dyndns.org/testsurvey.html
 HTTP_ACCEPT_LANGUAGE=en-us
 HTTP_ACCEPT_ENCODING=gzip, deflate
 HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
 HTTP_HOST=ardai.dyndns.org
 HTTP_CONNECTION=Keep-Alive
 HTTP_CACHE_CONTROL=no-cache
 
 I have tried this with ie 6.0 sp1, netscape 7.1, and Opera 7.23 as my browser.  Both the webserver and browser are running Win2K.
 
 (edited to strip out more extraneous stuff from the html...)
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| aprelium -
 
 
 Joined: 22 Mar 2002
 Posts: 6800
 
 
 | 
			
				|  Posted: Mon Aug 09, 2004 1:44 am    Post subject: |   |  
				| 
 |  
				| n1ist, 
 Your HTML code seems fine. But we recommend trying to change your HTML to <form action="/cgi-bin/barcsurvey.exe" ...>. We suspect that you're using a redirection service that changes the request.
 
 Does it work now? If it is still not correct, please send to support@aprelium.com a compressed package containing your your HTML file and your .exe CGI application.
 _________________
 Support Team
 Aprelium - http://www.aprelium.com
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		| n1ist -
 
 
 Joined: 05 Aug 2004
 Posts: 4
 
 
 | 
			
				|  Posted: Tue Aug 10, 2004 12:48 am    Post subject: |   |  
				| 
 |  
				| Ugh.  Sometimes it is the obvious that gets you.  The system() call does an exec so it didn't inherit the updated environment.  Using getenv() to get the REQUEST_METHOD shows that it is POST.  Thanks. /mike
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		|  |