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

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 fill in your .

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

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-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(); check_fields($q); In

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; my

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

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

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

2004-06-15 Thread Wiggins d Anconia
snip 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
Please bottom post and group reply so everyone can help and be helped, and you run less risk of being accidentally ignored... Jason Gray wrote: What do you exactly mean by passing $q as an argument? In general you want to avoid the use of globals, and encapsulate your subroutines such that they