Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-27-2006, 11:00 PM   #1
Registered: Sep 2006
Posts: 35

Rep: Reputation: 15
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

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
Old 09-27-2006, 11:08 PM   #2
Registered: Sep 2006
Posts: 35

Original Poster
Rep: Reputation: 15
Here is some of my code if it helps it is not done and is sloppy
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
Old 09-28-2006, 02:03 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

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

--- rod.
Old 09-28-2006, 02:59 PM   #4
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
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.


should be


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
script to download a webpage pankaj99 Programming 4 09-23-2006 06:28 AM
Removing Characters when outputting to a script thedarkdestroyer Linux - Newbie 3 03-21-2006 03:13 PM
executing script via webpage through apache server feetyouwell Linux - Software 7 02-08-2004 03:23 PM
getting information from a webpage in terminal charlie123 Linux - Newbie 1 01-31-2003 05:58 AM
script to update my webpage yank_ Linux - General 0 02-16-2001 05:56 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration