seerson Posted February 5, 2008 Share Posted February 5, 2008 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 Quote Link to comment Share on other sites More sharing options...
haku Posted February 5, 2008 Share Posted February 5, 2008 Sorry, this forum isn't for fixing 3rd party scripts. Either your boss needs to hire a php programmer, or you need to learn php. Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 5, 2008 Share Posted February 5, 2008 You need to find where the values ($FTGfield12 $FTGfield13 $FTGfield14 $FTGfield15 $FTGfield16 $FTGfield17) are defined in the first page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.