in reply to modification of simple form-email script
isn't checking anything it is assigning someting. You wantif ($name = "firstname"){
'=' assigns '==' is numerical comparisons and 'eq' is for string comparisons. (by design not by force)if ($name eq "firstname"){
or something along those lines, but you shouldn't die in CGI either. There are much more graceful and correct ways to handle it. So a super search for CGI Ovid and you should find loads of helpful information.use CGI; use strict; my %FORM; map {$FORM{$_} = uri_unescape($cgi->param("$_"))} $cgi->param(); if ($FORM{firstname} eq '') { die print "must enter first name"; }
|
|---|