Need help with Displayed Results working with checkboxes

Hello,

From trial and error, I have managed to pull data filled out on my website and have it compiled into a nice email. Everything looks good… except when there’s no selection made.

See Below: This is the area of concern (in red)

You have received a new quote from Support Team located in North Carolina.

The preferred method of contact is Email.

The purpose of the contact: Get a Quote.

The type of insurance that the request is for:

Commercial Insurance: Business Liability

Personal Insurance: Comprehensive Personal Liability

When a category does not have a selection, this is the output:

You have received a new quote from Support Team located in North Carolina.

The preferred method of contact is Email.

The purpose of the contact: Get a Quote.

The type of insurance that the request is for:

Commercial Insurance:
Warning: implode() [function.implode]: Bad arguments. in /homepages/31/d237632830/htdocs/wsb4851896901/components/com_chronocontact/chronocontact.php(350) : eval()'d code on line 8

Personal Insurance: Condo/Renters, Watercraft


This is the coding that I am using in my email template:

You have received a new quote from <?php echo $_POST["name"]; ?> located in <?php echo $_POST["state"]; ?>.


The preferred method of contact is <?php echo $_POST["contact"]; ?>.



The purpose of the contact: <?php echo $_POST["field-116839a98fa58fc"]; ?>.



The type of insurance that the request is for:

Commercial Insurance: <?php echo $_POST['commercial_insurance'] = implode(', ', $_POST['commercial_insurance']); ?>


Personal Insurance: <?php echo $_POST['personal_insurance'] = implode(', ', $_POST['personal_insurance']); ?>

Check under New Leads for additional contact information


What coding do I need to add to leave the selection area blank, if no choice is made in that category?

BAD! DO NOT USE EVAL()!! If I give malicious input and you’re executing it through eval() I WILL HAVE COMPROMISED YOUR SERVER MACHINE! Get RID of it!

To solve the actual issue, which is that implode() is defecting, make sure you’re feeding it an array as its second parameter. Make sure it’s not an empty var.

Sponsor our Newsletter | Privacy Policy | Terms of Service