close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Need email to remove empty fields

Thread began 4/15/2019 10:27 am by lr_leal239405 | Last modified 4/26/2019 9:22 am by lr_leal239405 | 994 views | 10 replies

lr_leal239405

Need email to remove empty fields

I have a form with hundreds of fields. I want the email to show only the fields that are populated (that have something on the $_POST). I tried the bottom script - (added 'if(!empty...' line to what was generated by webassist) but it doesn't work:

<?php
if(!empty($_POST)) {
foreach( $_POST as $pkey => $pval ){
if (!RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes)) {
if (get_magic_quotes_gpc()) $pval = stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
<tr valign="top">
<th style="font-family: 'Times New Roman', Times, serif; font-size: 10px;width: 134px; text-align: right; padding: 3px 10px 3px 3px; color: #666; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
<td style="font-family: 'Times New Roman', Times, serif; font-size: 10px;padding: 3px; border-left: 1px solid #DDD; color: #B6B6B6;"><?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
</tr>
<?php
}
}
}
?>

Also, this form if very complex. I have it all built, but I may need your help. I need to get it to populate the db, one line per fieldset. May be hard to explain but you can see my form here: (I believe I have everything else working with some spaghetti code). :)

Thank you!

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...