The links are real, and the message sent is "Premature end of scripts headers",
like if I tryied to print something before sending the header, but I reviewed my
code and only at last I send a print message, validated for any kind of call:


It looks something like:

   if ($bExternal) { print "Location:$Response\n\n"; }
   elsif (defined($cInput{js})) { print
   "Content-type:text/plain\n\n$cResponse"; }
   elsif defined($cInput{txt})) { print
   "Content-type:text/plain\n\n$cResponse"; }
   elsif defined($cInput{html})) { print
   "Content-type:text/html\n\n$cResponse"; }
   else { print "Content-type:text/plain\n\n$cResponse"; }

Where $cResponse has the external uri, or the code to response.

About using the CGI.pm, the answer is no. I am not using due the amount of calls. I implemented
as an internal subroutine that is called as &ReadInput(*cInput); and the code is almost
like the original routine:


   sub ReadInput
    {
    # Capture variable pointer
    local (*cFormatedData) = @_ if @_;
    # Create local variables
    local ($cRawData,@cData,$nParam,$cKey,$cValue);
    # Get raw data
    if ($ENV{'REQUEST_METHOD'} eq "GET")
      { $cRawData = $ENV{'QUERY_STRING'};}
    else # if ($ENV{'REQUEST_METHOD'} eq "POST")
      { read(STDIN,$cRawData,$ENV{'CONTENT_LENGTH'});}
    # Split data
    @cData = split(/[&;]/,$cRawData);
    foreach $nParam (0 .. $#cData)
      {
      # Re-convert spaces
      $cData[$nParam] =~ s/\+/ /g;
      # Separate key and value to later re-convert special chars
      ($cKey, $cValue) = split(/=/,$cData[$nParam],2);
      $cKey =~ s/%(..)/pack("c",hex($1))/ge;
      $cValue =~ s/%(..)/pack("c",hex($1))/ge;
      # Associate key and value in a new array
      $cFormatedData{$cKey} .= "\0" if (defined($cFormatedData{$cKey}));
      $cFormatedData{$cKey} .= $cValue;
      }
    return scalar(@cFormatedData);
    }

The only module I load is at the beggining of the code, at 2nd line:

use CGI::Carp qw(fatalsToBrowser);



Wiggins d Anconia wrote:



I created a CGI that returns an txt code (to display a banner), but what it looks strange to me is that if I call it with only one parameter (type of code to return, and associated variable) it works fine, but if I use an other parameter, it sends me an error message.

This works fine:
http://www.go4new.biz/cgi-bin/horiz.cgi?js=1

Those do not work:
http://www.go4new.biz/cgi-bin/horiz.cgi?js=1&query=information
http://www.go4new.biz/cgi-bin/horiz.cgi?query=display&js=1

Any idea about where may be the error?





What is the error that is sent? I am assuming the above links are real, which displays an Internal Server Error, what does the error log say?

There is not a lot of help that can be provided based on what you have
told us. Are you using the CGI.pm module?


http://danconia.org







--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to