I have a basic script using cgi.pm that is supposed to take one form filed
and pass it to a subroutine where I will validate the input.  However, when
it gets passed, all that prints to the browser is a 1.  Can anyone offer any
suggestions before I pull the rest of my hair out?

Here is the script:

#!/usr/bin/perl
use strict;
use lib qw(/home/usr25/data/lib/mailer);
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use ahSubscribe;

my $choice = lc (param ("choice"));

if ($choice eq "") {
        subscribeForm();
}
elsif ($choice eq "subscribe") {
        validateEmail( param ( "email" ) );
}
###
sub subscribeForm {
print header(),
start_html (-title => "Subscribe Form", -bgcolor => "#ffffff");
print start_form (-action => url()),
        table(
                Tr (
                        td ("E-mail Address:"),
                        td (textfield (-name => "email", -size => 20))
                   ),
                Tr (
                        td ({-colspan => 1}, submit (-name => "choice",
-value => "subscribe")),
#                       td (" ")
                   ),
                ),
end_form ();
print end_html();
}
###
sub validateEmail {
my $email = shift;
print header(),
start_html (-title => "Validate Email", -bgcolor => "#ffffff"),
print p ("this is what you entered $email");
print end_html();
}

#######################################

When I view the source of the generated page, it won't even print the static
text in the paragraph tag.  Take a look:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
        "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
lang="en-US"><head><title>Validate Email</title>
</head><body bgcolor="#ffffff">1</body></html>


Any suggestions are greatly appreciated!

Thanks in advance,
Andrew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to