I'm trying to get an html page to run cgi script, using the form "GET" command. When I submit my form entry, I'm then prompted to either open, save or cancel the cgi script. I can run the script independently but not through the html page. Any ideas? Perhaps I have my Apache server set up in correctly. I should also note, I'm using apache 2.2.11 and both files are stored in the same file path (cgi-bin).
Here's the html:
<html><head><title>Test Form</title></head>
<body>
<form action="10_cgi.cgi" method="GET">
Enter some text here:
<input type="text" name="sample_text" size=30>
<input type="submit">
</form>
</body></html>
Here's the cgi ("10_cgi.cgi"):
#!/perl/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
print header;
print start_html( "Get Form" );
#my %form;
#foreach my $p (param()) {
# $form{$p} = param($p);
# print "$p = $form{$p}<br>\n";
#}
print end_html;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.