httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aman Raheja <arah...@techquotes.com>
Subject Re: [users@httpd] internal error running cgi script
Date Fri, 03 Dec 2004 21:26:23 GMT
last line should be

print "</BODY>\n</HTML>\n";

not

print "</BODY>\n</HTML>\n;

you are missing a "

checl error logs in future, you'll know syntax probs.
Aman Raheja


Ben Kuang wrote:

>Hi everyone:
>
>I am learning cgi scripting and running apache locally.  I have a form
>in html that takes user input, and a cgi script in perl, to print on
>screen what the user has entered:
>
>Here is the html document, place in htdocs dir:
>
><html>
><body>
><b><font size=6>Test</font></b> 
><hr>
>
><form method="post" action="../cgi-bin/script1.pl">
><textarea name="comment" rows=8 cols=68></textarea>
>
><br>
><input type=submit value="Send">
><input type=reset value="Reset">
></form>
>
></body>
></html>
>
>Here is my cgi script script1.pl, in perl, located in cgi-bin dir:
>
>#! /usr/bin/perl -w
>#script1.pl 
>print "content-type: text/html\n\n";
>read(STDIN, $format, $ENV{'CONTENT_LENGTH'});
>print "<HTML><HEAD>\n";
>print "<TITLE>Echo Form Data</TITLE>\n";
>print "</HEAD><BODY>\n";
>print "Here is what was collected\n";
>print "<HR>\n";
>@namevals = split(/&/, $formdat);
>foreach (@namevals){
>	tr/+/ /;
>	s/%(..)/pack("C", hex($1))/ge;
>	print "$_<BR>\n";
>}
>print "<P><HR>\n";
>print "</BODY>\n</HTML>\n;
>
>This is the error i get when I try to run the script:
>
>Internal Server Error
>
>The server encountered an internal error or misconfiguration and was
>unable to complete your request.
>
>Please contact the server administrator, bensdomain12@gmail.com and
>inform them of the time the error occurred, and anything you might
>have done that may have caused the error.
>
>More information about this error may be available in the server error log.
>
>Can anyone please help me with this problem.  Thank you very much in advance.
>
>I am running apche in a windows environment, not *nix.
>
>Sincerely,
>
>Ben Kuang
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>  
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message