Anyone know cgi?

rainman89

I cant find the any key..
Local time
Today, 03:37
Joined
Feb 12, 2007
Messages
3,015
Hi all,
Trying to launch a webform but im getting this error on submit

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

The system cannot find the path specified.
The system cannot find the path specified.
Ive looked everywhere to try to find an example.. its on an NT server which i was told doesnt need to have permissions modified(was i lied too???)

Below is the script i am trying to run.... im at my wits end trying to figure this one out! any help is appreciated.

Code:
#!/usr/bin/perl
# Stuff circa 1998-99 rmo
use 5.004;
use CGI qw(:standard);
use vars qw($query @lines);
use subs qw(&extract_form_data &bail);
$query = new CGI();

@lines = ();
@lines = &extract_form_data();

my $COMMAND = '/usr/lib/sendmail -oi -t -f';
my $Email = $query->param('Email') ||
   &bail('ERROR',"No/invalid recipient specified");

my $opr = 'me@myplace.com';
my $subject= "Request from website";


open(MAIL,"|$COMMAND $Email" . ' > /dev/null 2>&1');
print MAIL "Subject: $subject\n";
print MAIL @lines;
close (MAIL);



open(MAIL,"|$COMMAND $opr" . ' > /dev/null 2>&1');
print MAIL "Subject: $subject\n";
print MAIL @lines;
close (MAIL);

sub extract_form_data
{
  # my @lines = ();
   foreach my $name($query->param) {
	push @lines, $name. " = " . 
$query->param($name);
		
   }
   return (join "\n", @lines). "\n";
}
 
sub bail
{
   my $title = shift;
   my $error = "@_";
   my $result =  header(-type => 'text/html');
      $result .= start_html(-TITLE => $title, -bgcolor => '#ffffff',
                            -text => '#000000', -vlink => '#006600',
                                                 -link => '#006600', );
$result .= b($error);
$result .=<<EOS;
</p><p>
<center>
THANK YOU<br>
A confirmation Email has been sent to you at:
$Email<br>
</center>

<a href="javascript:history.go(-1); return false;"
   onMouseOver="window.status='Go back to update form'; return true;"
   onClick="javascript:history.go(-1); return false;"
>Go Back</a>
</p>
EOS
   $result .= end_html;
   $result .= "\n";
   print $result;

   exit 0;
}
 
A question ...

Rainman89,

I'll preface this by saying, I don't know perl. So, given that, I would verify two things:
1. Does the NT server have Perl installed?
2. Does the server have sendmail installed?

IMHO, the script needs to be tweaked, as it was written for *nix.

My 0.02c

Alex
 
Check with your hosting company if
#!/usr/bin/perl is actually the path to perl
 
#!/usr/bin/perl

Is this really the path to perl?
The exclamation mark looks wrong to me
Check path with your hosting company
 
Thanks guys. i had us switched over to a linux machine so i think itll run better. fyi the #! is how u specify paths in perl! thanks for the help
 

Users who are viewing this thread

Back
Top Bottom