diff --git a/sendform.php b/sendform.php index 64098f6..3991d51 100644 --- a/sendform.php +++ b/sendform.php @@ -1,8 +1,5 @@ $varval) { + if($ignoreempty===true && empty($varval)) continue; if(is_array($varval)) $varval = implode(", ",$varval); if(!exclude($varname)) { $message .= "$varname: "; @@ -184,12 +192,13 @@ } function writetemplate($thefile) { - global $message, $theDomain; + global $message, $theDomain, $ignoreempty; $thearray = Array(); if($fp = @fopen($thefile, 'r')) { while($data = fgets($fp, 1024)) { $data = chop($data); foreach($_POST as $varname => $varval) { + if($ignoreempty===true && empty($varval)) continue; if(is_array($varval)) $varval = implode(", ",$varval); $data = str_replace("[$varname]", $varval, $data); }