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
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
Code:
#!/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))/eg; $FORM{$name} = $value; } }
Comment