Solved

CGI  ERROR !!!!!!!!!!!!!!!!!1

Posted on 1998-11-10
11
165 Views
Last Modified: 2013-12-25
I CAN'T POST VIA MY HTML I GET THIS ERROR MESSAGE
"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"

I USE THIS HTML :

<form ACTION="VV.exe" METHOD="GET">
  <p><u><strong><big>Total</big></strong></u> <input TYPE="TEXT" NAME="total" SIZE="2"> <br>
  </p>
  <p><input TYPE="submit" VALUE="Submit"></p>
</form>

I USE NT SERVER 4
AND IIS SERVER

THANK YOU FOR TRYING TO HELP ME !!



0
Comment
Question by:neta
11 Comments
 
LVL 10

Expert Comment

by:rbr
ID: 1829501
The error is in the VV.exe. Can you pls post this code.
0
 

Author Comment

by:neta
ID: 1829502
Edited text of question
0
 

Author Comment

by:neta
ID: 1829503
i write application writen in j++ 6 and  make an
exe file (vv.exe) from the application.
now the cgi i have made give me the error.
Is it becuse the parameter i write from the java application
cant be display as a cgi?.
if i try to pas the parameters vv.exe?2121 i get the error
but i get it in the cgi and print them out to the browser.
the code which pritnt it out is
System.out.println(args[0]);



0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1829504
Just a question:

If you use IIS 4 why don't you use ASP?  It is much easier to do server interaction with the web.
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829505
please give us the code of the java applet/program...You are not outputting correct headers. Once I see code I can help you with it.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 7

Expert Comment

by:faster
ID: 1829506
You need to have "Content-type: text/html\r\n\r\n" at the start of your output.  The important thing is two end-of-line, "\n\n" also works.
0
 

Author Comment

by:neta
ID: 1829507
Verey good FASTER this fix the problem
But I have a biger Problem
i GET FROM THE JAVA cgi

Error :

java.lang.ArrayIndexOutOfBoundsException


MY PSADO "COD":
public static void main (String[] args){
        
YourClass b = new YourClass(args[0]); //THIS PASS THE PARAMETER
        
        START TREAD B

          WAIT FOR 5400 SEC THEN STOP.

}



public class YourClass implements Runnable
         {
    String name ;
 
  public YourClass(String v){
             

              name = v;  
              }
             
             
             
public void run(){

System.out.println("Content-type: text/html\n");
System.out.println("<pre>");
System.out.println(name);

System.out.println("</HTML>");
System.out.println("</pre>");
System.out.println("</body>");
System.out.println("</html>");
                              
                              
   }
         
}
 
                         
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829508
as said, the line that contains
System.out.println("Content-type: text/html\n");

should be changed to
System.out.println("Content-type: text/html\r\n\r\n");
or if that does not work to
System.out.println("Content-type: text/html\n\n");

Then, I would suggest that you output the <html><head></head><body> headers around your html code to make it comply with HTML rules.

any questions?



0
 

Author Comment

by:neta
ID: 1829509
good answer but i need more
pleas try to help me getting the parameters
mybe you know how what are the java's method that
get the environment parameters from the html
and i dont want to use servelet.

0
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 200 total points
ID: 1829510
your question was not really asking for this...anyway. I do not know how the java call for environment variables is, but I assume it is getEnv or something similar. You get the parameters from the environment variable QUERY_STRING and these will be in the form para1=val1&para2=val2&test&para3=val3, so you need to parse it to extract the information.

If you intend to do this, then I suggest you obtain a CGI library written in C++ or Java (www.cgi-resources.com is your place to start).

later,
MaDdUCK
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829511
still there?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now