Re: a way to make this more secured and better written?

2004-06-23 Thread Jason Gray
or would this be much better? #!/usr/bin/perl -T use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); # Email address where form submits are sent. my $email = '[EMAIL PROTECTED]'; # Your subject for the form submits. my $subject = '[INFO] Site Comment'; print $q->header

Re: a way to make this more secured and better written?

2004-06-22 Thread Jason Gray
"Jason Gray" <[EMAIL PROTECTED]> wrote in message news:... > Could I do this? > > sub check_fields { > my $q = shift; > my $match; > my @fields = ('name', 'email', 'city', 'state', 'message'); > foreach my $field (@fields) { > next if ($q->param($field)); > $match = 0; > print "Please fi

Re: a way to make this more secured and better written?

2004-06-18 Thread Jason Gray
So would this solve the problem? check_fields($q); sub check_fields { my $q = shift; my @fields = qw(name email city state message); foreach my $field (@fields) { next if ($q->param($field)); print 'Please fill in the blank fields.'; exit; } unless (Email::Valid->address($q->param('ema

Re: a way to make this more secured and better written?

2004-06-17 Thread Wiggins d Anconia
> Is this how you were talking about getting rid of globals, and does this > seem correct? > > #!/usr/bin/perl -T > > use strict; > use warnings; > > use lib '/home/perl-lib/modules'; > > use CGI; > use Email::Valid; > use Mail::Mailer; > > my $q = CGI->new(); > > print $q->header(); > > che

Re: a way to make this more secured and better written?

2004-06-17 Thread Jason Gray
Is this how you were talking about getting rid of globals, and does this seem correct? #!/usr/bin/perl -T use strict; use warnings; use lib '/home/perl-lib/modules'; use CGI; use Email::Valid; use Mail::Mailer; my $q = CGI->new(); print $q->header(); check_fields($q); sub check_fields { my

Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d'Anconia
s d Anconia" <[EMAIL PROTECTED]> To: "Jason Gray" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, June 15, 2004 10:18 AM Subject: Re: a way to make this more secured and better written? #!/usr/bin/perl -w use strict; use warnings; You probably don't want

Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d Anconia
> > > my @fields = qw(name email city state message); > > foreach my $field (@fields) { > > $blanks++ if !$q->param($field); > > } > for(@fields) { $blanks ++ if $q->param($_) eq ''; } > IMO, I disagree that removing whitespace and switching a named variable such as $field to $_ is an

Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d Anconia
> #!/usr/bin/perl -w > > use strict; > use warnings; You probably don't want both -w and 'use warnings'. Personally I would stick with the 'use warnings' unless you have to deal with older versions of Perl which is not terribly likely. The -w turns on warnings for the whole script, which will in

Re: a way to make this more secured and better written?

2004-06-15 Thread JupiterHost.Net
Jason Gray wrote: #!/usr/bin/perl -w use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); print $q->header(); #- # * startup methods -> global variables. check_fields(); #- sub check_fields { my

a way to make this more secured and better written?

2004-06-15 Thread Jason Gray
#!/usr/bin/perl -w use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); print $q->header(); #- # * startup methods -> global variables. check_fields(); #- sub check_fields { my $blanks; m