Solved

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

Posted on 1998-11-10
11
164 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 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

15 Experts available now in Live!

Get 1:1 Help Now