On Sat, 17 Sep 2005, David Swiderski wrote:

> 
> Hi Owen, Thanks for your reply to my email.  Follows is my perl script which
> I'm trying to get it to display a message.
> 
> perl script email.pl
> #!/usr/bin/perl
<snip>
> # Gets the data from the form

>   &parse_form;


Wow

OK, looks like you are using a script written in the early 90s.

What you have is a html page that has a form and and action script,
email.html.

What you want is as I described before, a script that 
1. produces the form
2. processes the form

What you have now wont do that.

Something like this(demo at http://www.pcug.org.au/~rcook/tute.cgi) 

#!/usr/bin/perl

use strict;
use CGI;

my $form = new CGI;
print $form->header("text/html");
print $form->start_html(-title => 'Blah Blah');

my $name =  $form->param("name")||'';
my $email = $form->param("email")||'';

show_form() if ($email eq '');
thank_you();
$form->end_html;
exit();

sub show_form{# The initial form
print $form->start_form;
print $form->textfield('name','',30,50);
print " Your name\n<p>";
print $form->textfield('email','',30,256);
print " Your email\n<p>";
print $form->submit;
print $form->reset;
print $form->end_form;
exit();
}

sub thank_you{#thankyou note

print "Thanks, your email was so important to us we sent it to the
moon\n";

#now do your sendmail routine
}

--------------------------------------------

perldoc CGI

expand to suit your needs(extra fields, checks, error messages)




Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to