girl has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am having a lot of trouble with getting a file to load. When i try it says internal server error. When i go to error logs to check what the problem is, it say premature ending of script headers.
I tried changing the permissions to 755. I think i fixed all the syntax errors.
it still won't work. :(
Here is the page
#!/usr/bin/perl use 5.006; #! /usr/bin/perl &form_parse; $firstnumber = $FORM{'firstnumber'}; $secondnumber = $FORM{'secondnumber'}; $operation = $FORM{'operation'}; print "Content-type: text/html\n\n"; &printconfirmation; ############################################################ # CONFIRMATION PAGE ############################################################ sub printconfirmation { print <<ENDCONFIRMATIONPAGE; <html> <head> <title>Demo Confirmation Page</title> <style> td { background-color: white; font-size: 16pt; } input { font-size: 16pt; background-color: #E7CFCF; color: #FF6633; } select { font-size: 16pt; background-color: #E7CFCF; color: #FF6633; } textarea { font-size: 16pt; background-color: #E7CFCF; color: #FF6633; + } </style> </head> <body bgcolor="white" text="#FF6633" alink="#FF6633" vlink="#FF6633"> <br><p><br> <p><center><h1><b>The answer is: $firstnumber</b> </h1></center> <P ALIGN="center"><p>$answer<br> <p><br><p> </P> <P><br> <BR><P> </body> </html> ENDCONFIRMATIONPAGE } ############################################################ # FORM PARSE ############################################################ sub form_parse { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs){ ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/\'//g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/e +g; $FORM{$name} = $value; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help!! Premature ending of script headers?
by ~~David~~ (Hermit) on Oct 13, 2011 at 17:41 UTC | |
|
Re: Help!! Premature ending of script headers?
by Anonymous Monk on Oct 13, 2011 at 22:43 UTC | |
|
Re: Help!! Premature ending of script headers?
by aaron_baugher (Curate) on Oct 14, 2011 at 11:29 UTC | |
|
Re: Help!! Premature ending of script headers?
by DanielSpaniel (Scribe) on Oct 13, 2011 at 19:47 UTC | |
by chromatic (Archbishop) on Oct 13, 2011 at 20:44 UTC | |
by DanielSpaniel (Scribe) on Oct 13, 2011 at 23:25 UTC |