LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Outputting information from my script to a webpage (https://www.linuxquestions.org/questions/programming-9/outputting-information-from-my-script-to-a-webpage-487584/)

circuit_girl 09-27-2006 11:00 PM

Outputting information from my script to a webpage
 
I have a script that I run with a html form.
The form has an text input and two sets of radio buttons. The goal of this web page is to convert one type of currency to another type of currency.

When I hit the submit button I get an Internal Server Error. i blocked all of my code off as comments with #.

So everything is blocked off the only code I have is

Code:

!#/usr/bin/perl
print "Content-type\:text/html\n\n";
print "<html>";

I even tried to comment the print "<html>" nothing is working.

I need help outputting my currency results to a new html document.

Please Help
Circuit_Girl

circuit_girl 09-27-2006 11:08 PM

Here is some of my code if it helps it is not done and is sloppy
Code:

!#/usr/bin/perl
print "Content-type\:text/html\n\n";

print "<html>";
#$str = $ENV{QUERY_STRING}; #get info from the web pages query string to use info for computation
#($amount, $curr_type1, $curr_type2) = split(/&/, $str);

#print "<html>";
#print "<head><title>Currency Converter</title></head>";
#print "<body bgcolor=green text=white>";
#print "<center><h1>Currency Results</h1></center>";
#print "</body>";
#print "</html>";
#Not Sure What These Do Need to Find Out
#use strict;
#use warnings;
#use CGI qw(:standard);
#use CGI::Carp qw(fatalsToBrowser);

#I am sure there is an easier way to do this but I do not know.
#I am placing a name in a variable for both types so I can output them to the web page.
#if ($curr_type1 eq 'u')
#{
#  $curr_name1 = "Us Dollar(s)";
#}
#if ($curr_type1 eq 'c')
#{
#  $curr_name1 = "Canadian Dollar(s)";
#}
#if ($curr_type1 eq 'e')
#{
#  $curr_name1 = "Europian Euro(s)";
#}
#if ($curr_type1 eq 'm')
#{
#  $curr_name1 = "Mexican Peso(s)";
#}
#if ($curr_type1 eq 'p')
#{
$curr_name1 = "English Pound(s)";
#}
#if ($curr_type2 eq 'u')
#{
#  $curr_name2 = "Us Dollar(s)";
#}
#if ($curr_type2 eq 'c')
#{
#  $curr_name2 = "Canadian Dollar(s)";
#}
#if ($curr_type2 eq 'e')
#{
#  $curr_name2 = "European Euros(s)";
#}
#if ($curr_type2 eq 'm')
#{
#  $curr_name2 = "Mesican Peso(s)";
#}
#if ($curr_type2 eq 'p')
#{

Just to give an idea of what I am trying to do
Sorry if I can not explain very well

theNbomr 09-28-2006 02:03 PM

Have you consulted your web server error log file? Do you have other cgi-bin perl scripts that do work on this server?

--- rod.

xhi 09-28-2006 02:59 PM

usually a 500 error is permissions on your cgi files you are trying to execute. but as was mentioned, you need to check the error log for the server.

also
!#/usr/bin/perl

should be
#!/usr/bin/perl


All times are GMT -5. The time now is 07:49 PM.