develooper Front page | perl.beginners | Postings from February 2002

Perl-CGI-script for communication via webserver Thttpd

From:
Hein ten Rouwelaar
Date:
February 26, 2002 09:16
Subject:
Perl-CGI-script for communication via webserver Thttpd
Message ID:
20020226165641.98317.qmail@onion.perl.org
Hi,

I am a newbe in Perl. I installed the webserversoftware thttpd-2.20b-4 on a
RedHat Linux 7.1 host (hostname "linux"). Browser on client 200.1.1.5.

Now I wrote the html page below which calls the perl script printed below
again.

The query displays nice on my browser (IE5.0)and I can submit the answers.
Now one would expect the output of the perl-cgi script to be displayed by
the browser. But nothing whatsoever is send to the browser at all.

The logging from the webserver (thttpd) shows the GET ..... message from the
submit is received from the browser. The webscreen on the browser is blanked
and that's it.

The directory cgi-bin is a subdirectory of my homedir which is laso the
current workingdir of the webserver.
The modebits of the htmlpage are 644 and of the perl-cgi script 755. The
directory has 755.

Has anybody any guess what I am missing here ???

----HTML page----

<HTML><HEAD><TITLE>Guestbook</TITLE></HEAD>
<BODY>
<H1>Fill in please</H1>
<FORM METHOD="GET" ACTION="/cgi-bin/guest.pl">
<PRE>
Age: <INPUT TYPE="TEXT" NAME="Age">
Length: <INPUT TYPE="TEXT" NAME="Length">

<INPUT TYPE="SUBMIT"> <INPUT TYPE="RESET">
</PRE></FORM></BODY></HTML>


----Perl-CGI script----

#!/usr/bin/perl

use CGI qw/:cgi/;

$Lt = param("Age");
print header();
print p("Your age is $Lt");


----Thttpd logging----

200.1.1.5 - - [25/Feb/2002:21:45:22 +0100] "HEAD /guest.html HTTP/1.1" 304
279 "" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)"
200.1.1.5 - - [25/Feb/2002:21:45:30 +0100] "GET
/cgi-bin/guest.pl?Age=55&Length=88 HTTP/1.1" 200 50000
"http://linux/guest.html" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 95;
DigExt)"







nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About