httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Fellows <lfell...@4lane.com>
Subject Re: Re: httpd.conf settings preventing perl cgi?
Date Fri, 31 May 2002 11:50:37 GMT
Uh, what exactly do you think this is going to print?

  This script, in colors.txt is expecting POST info and parsing it.  If
 it does not receive post info, then it will print 'Results' and nothing
 else.  This script will never produce a submission form, if that is
 what you expected.

colors.txt follows:

#!/usr/bin/perl

print "Content-type:text/html\n\n";

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $FORM{$name} = $value;
}

print "<html><head><title>Results</title></head>\n";
print "<body>\n";
print "<h2>Results</h2>\n";

@colors = ("red","green","blue","gold");
foreach $x (@colors) {
    if ($FORM{$x} == 1) {
	print "You picked $x.\n";
    }
}

print "</body></html>\n";



On Thu, 2002-05-30 at 17:17, Melvin Thomas Melvin wrote:
> I was running 1.3.24 compiled with HP's ansi C compiler, and based on your message I
tried to compile 2.0.36, the compile worked, but I get the error:
> 
> [Thu May 30 17:09:05 2002] [emerg] (19)No such device: Couldn't create accept lck   
                                                                         
> 
> And the server does not start.
> 
> As for my original problem, I can run the printenv and test-cgi scripts. The example
I am trying to use is from:
> 
> http://www.cgi101.com/class/ch5/colors.txt
> 
> And all it displays is "Results" when it runs, with no errors in the error_log, or the
command line from perl.
> 
> Thanks
> -m
> -----Original Message-----
> From: Joshua Slive <joshua@slive.ca>
> To: <users@httpd.apache.org>
> Date: Thu, 30 May 2002 13:40:55 -0700 (PDT)
> Subject: Re: httpd.conf settings preventing perl cgi?
> 
> 
> On Thu, 30 May 2002, Melvin Thomas Melvin wrote:
> 
> > If this is not the appropriate place for PERL/CGI questions, please tell me what
is...
> >
> > I have been trying to get a "hello world" cgi script with a form in it to work on
1.3.20 on HP/UX 11.0, and all I get is what should happen after the button is pressed.
> >
> > I have tried several PERL scripts and all perform post-form stuff. I don't know
if it's a PERL issue, an Apache issue, or an OS issue.
> >
> 
> It sounds like apache is not configured to execute the cgi script.
> Is it in a cgi-bin directory?  You should take a look at
> http://httpd.apache.org/docs-2.0/howto/cgi.html
> and if you still can't figure things out, provide us with the
> exact details of how you have configured it.
> 
> Joshua.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message