Jump to content

help on PHP Form that emails ALL possible choices instead what user selected


Recommended Posts

:(

 

Hi all. My predecessor created a PHP form that is not working correctly for the client and I have never had to edit PHP before. Here is the question. The form has a series of checkboxes that the user can choose from (one or more choices can be made). These selected choices are to be what is emailed to the client. However the client receives email that lists ALL the choices, not just was selected by the user.

 

-------

portion of code in question from the PHP script in question:

 

# Email to Form Owner

 

$emailSubject = FilterCChars("Tab Website Contact Form");

 

$emailBody = "Name : $FTGfield0\n"

. "Company : $FTGfield1\n"

. "Address : $FTGfield2\n"

. "City : $FTGfield3\n"

. "State : $FTGfield5\n"

. "Zip : $FTGfield113\n"

. "Home Phone : $FTGfield7 $FTGfield7a $FTGfield7b\n"

. "Business Phone : $FTGfield8 $FTGfield8a $FTGfield8b\n"

. "Cell Phone : $FTGfield9 $FTGfield9a $FTGfield9b\n"

. "Email : $FTGfield112\n"

. "Contact Regarding : $FTGfield12 $FTGfield13 $FTGfield14 $FTGfield15 $FTGfield16 $FTGfield17\n"

. "Comments : $FTGfield114";

$emailTo = 'andrea <andrea@companyname.com>';

 

$emailFrom = FilterCChars("$FTGfield112");

 

$emailHeader = "From: $emailFrom\n"

  . "MIME-Version: 1.0\n"

  . "Content-type: text/plain; charset=\"ISO-8859-1\"\n"

  . "Content-transfer-encoding: 8bit\n";

 

mail($emailTo, $emailSubject, $emailBody, $emailHeader);

 

 

 

 

-------

code in question on php web page (user is to check 1 or more. ONLY these selections are to be emailed to the client)

<li>

<label class="desc" for="field12">Please contact me regarding: <b>(Select At Least One)</b></label>

<span>

<input id="field12" name="field12" class="field checkbox" type="checkbox" value="Design/Build"/>

<label class="choice" for="field12">Design/Build</label>

<input id="field13" name="field13" class="field checkbox" type="checkbox" value="Construction Management"/>

<label class="choice" for="field13">Construction Management</label>

<input id="field14" name="field14" class="field checkbox" type="checkbox" value="General Contractor"/>

<label class="choice" for="field14">General Contractor</label>

<input id="field15" name="field15" class="field checkbox" type="checkbox" value="Project Partnerships/Investing"/>

<label class="choice" for="field15">Project Partnerships/Investing</label>

<input id="field16" name="field16" class="field checkbox" type="checkbox" value="Architectural Services"/>

<label class="choice" for="field16">Architectural Services</label>

<input id="field17" name="field17" class="field checkbox" type="checkbox" value="Consulting"/>

<label class="choice" for="field17">Consulting</label>

</span>

</li>

</ul>

 

 

-------

this is what the client receives - the Contact Regarding should have only listed the one or two selections I made on this test - not all of the possible selections.

 

Subject: Tab Website Contact Form

 

Name : Name

Company : Test

Address : 111 Main Street

City : City

State : IL

Zip : 11111

Home Phone : 

Business Phone : 111 111 1111

Cell Phone : 

Email : name@companyname.com <mailto:curt@createwithcurtis.com>

Contact Regarding : Design/Build Construction Management General Contractor

Project Partnerships/Investing Architectural Services Consulting

Comments : This is a test

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.