in reply to Re: Re: Re: Re: Premature end of script headers
in thread Premature end of script headers
Additionally - you are printing to the MAIL filehandle, but haven't opened it anywhere. You don't want to do that. Move the my $mailer = stuff before any of the print statements and then change all the MAIL lines to $mailer.
You also didn't create the CGI object used to redirect the page later.
You really want to look into hash slices. It could make your life a lot easier. The problem is that unless you have done form validation using JavaScript - you might be attempting to print an uninitalized variable. See my update to your code below:
That should move you along I think, still don't have a web server to test it on though. What were the errors you got with my code anyway?#!/usr/bin/perl -wT use CGI; use CGI::Carp qw(fatalsToBrowser); use Mail::Mailer; CGI::ReadParse(); my $query = CGI->new(); my $mailer = new Mail::Mailer ( "smtp" ); $mailer->open( { To => 'dawson.nicholas.a@edumail.vic.gov.au', From => $in{'Email'}, Subject => 'Travancore School Professional Development' } ); print $mailer "$in{'Title'}\n"; print $mailer "$in{'Name'}\n"; print $mailer "$in{'Position'}\n"; $mailer->close; print $query->redirect('http://www.travancoresch.vic.edu.au/developmen +t/reply02.html');
Cheers - L~R
|
|---|