Karmen Posted February 1, 2013 Share Posted February 1, 2013 Hi I need help, this was my first time setting up a web based form and using php. I created two forms hidden on a website that a href link will be sent to our clients to direct them to a survey. I have set everything up and everything is working but for some reason when the client hits send the data that the form captures is not pulled though to the admin email set up. I know it's something to do with my php. these are the surveys http://www.selections.co.za/feedbackSurveys/Survey_Supplier2012.html http://www.selections.co.za/feedbackSurveys/Survey_Student2012.html and this is my PHP doc for both. I can't see where i'm going wrong. Please help i'm desperate and need to get this working ASAP. I just can't SEE where I have made the error. HUGE Thanks Student php <?php /* Subject and Email Variables */ $emailSubject = 'Student Survey Completed '; $webMaster = 'nataliea@selections.co.za' ; /* Gathering Data Variables */ $emailField = $_POST['name']; $surnameField = $_POST['surname']; $institutionField = $_POST['institution']; $yearField = $_POST['year']; $telField = $_POST['tel']; $emailField = $_POST['email']; $productInfoField = $_POST['RadioGroup1']; $interactivePresentationField = $_POST['RadioGroup2']; $learnSomethingNewField = $_POST['RadioGroup3']; $commentsField = $_POST['comments']; $productsField = $_POST['products']; $body = <<<EOD <br><hr><br> Name: $name <br> Surname: $surname <br> Institution: $institution <br> Year: $year <br> Tel: $tel <br> Email: $email <br> Product Information: $productInfo <br> Interactive Presentation: $interactivePresentation <br> Learn Something New: $learnSomethingNew <br> Comments: $comments <br> Products: $products <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html> <head> <title>Selections Warehouse Student Feedback</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <style type="text/css"> <!-- body { background-color: #ADADA5; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; } .style14 {color: #69AAB7; font-weight: bold; font-size:8px; } .style4 { font-size: 11px; font-weight: bold; text-align: center; color: #000000; } --> </style> </head> <div> <div align="left"> <table width="658" align="center"> <tr> <td width="650" colspan="2" align="center" valign="top"><img src="../Ref/header_2.png" alt="1" width="650" height="200" /></td> </tr> <tr> <td width="650" height="59" colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><p> </p> <p>Thank you for successfully completing the student feedback servey. </p> <p>Sould you have any questions please feel free to contact us.</p> <p> </p></td> </tr> <tr> <td height="28" colspan="2" align="center" valign="middle" bgcolor="#D0CEC7" class="style4">Ground Floor, Wembly Square 2, Solan Street, Gardens, 8001 - Tel: 021 815 5798 - <a href="http://www.selections.co.za">www.selections.co.za</a></td> </tr> <tr> <td height="10" colspan="2" align="center" valign="middle" class="style4"><span class="style14">FIND US ON FACEBOOK AND LIKE OUR PAGE TO FIND OUT MORE ABOUT OUR UPCOMING FUNCTIONS, EXHIBITIONS AND EVENTS. </span></td> </tr> <tr> <td height="28" colspan="2" align="center" valign="middle" class="style4"><table width="14%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" valign="top"> </td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="http://pinterest.com/selectionswct/" title="Pintrest"><img src="../Ref/pinttrest.jpg" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="https://twitter.com/SelectionsW" title="twitter"><img src="../Ref/image_8451441.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="https://www.facebook.com/pages/Selections-Warehouse/161945277215671" title="fb"><img src="../Ref/image_4604455.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> </tr> </table> <div align="center"></div></td> </tr> </table> </div> </div> </body> </html> EOD; echo "$theResults"; ?> Supplier php <?php /* Subject and Email Variables */ $emailSubject = 'Supplier Survey Completed '; $webMaster = 'nataliea@selections.co.za' ; /* Gathering Data Variables */ $emailField = $_POST['name']; $surnameField = $_POST['surname']; $companyField = $_POST['company']; $telField = $_POST['tel']; $emailField = $_POST['email']; $displayField = $_POST['RadioGroup1']; $feedbackField = $_POST['RadioGroup2']; $serviceField = $_POST['RadioGroup3']; $remainField = $_POST['RadioGroup4']; $activitiesField = $_POST['activities']; $improvementField = $_POST['improvements']; $body = <<<EOD <br><hr><br> Name: $name <br> Surname: $surname <br> Company: $company <br> Tel: $tel <br> Email: $email <br> Display: $RadioGroup1 <br> Feedback: $RadioGroup2 <br> Service: $RadioGroup3 <br> Remain: $RadioGroup4 <br> Activities: $activities <br> Improvement: $improvements <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html> <head> <title>Selections Warehouse Supplier Feedback</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <style type="text/css"> <!-- body { background-color: #ADADA5; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; } .style14 {color: #69AAB7; font-weight: bold; font-size:8px; } .style4 { font-size: 11px; font-weight: bold; text-align: center; color: #000000; } --> </style> </head> <div> <div align="left"> <table width="658" align="center"> <tr> <td width="650" colspan="2" align="center" valign="top"><img src="../Ref/header.png" alt="1" width="650" height="200" /></td> </tr> <tr> <td width="650" height="59" colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><p> </p> <p>Thank you for successfully completing the supplier servey. </p> <p>Sould you have any questions please feel free to contact us.</p> <p> </p></td> </tr> <tr> <td height="28" colspan="2" align="center" valign="middle" bgcolor="#D0CEC7" class="style4">Ground Floor, Wembly Square 2, Solan Street, Gardens, 8001 - Tel: 021 815 5798 - <a href="http://www.selections.co.za">www.selections.co.za</a></td> </tr> <tr> <td height="10" colspan="2" align="center" valign="middle" class="style4"><span class="style14">FIND US ON FACEBOOK AND LIKE OUR PAGE TO FIND OUT MORE ABOUT OUR UPCOMING FUNCTIONS, EXHIBITIONS AND EVENTS. </span></td> </tr> <tr> <td height="28" colspan="2" align="center" valign="middle" class="style4"><table width="14%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" valign="top"> </td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="http://pinterest.com/selectionswct/" title="Pintrest"><img src="../Ref/pinttrest.jpg" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="https://twitter.com/SelectionsW" title="twitter"><img src="../Ref/image_8451441.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> <td align="middle" valign="top" width="5"></td> <td align="right" valign="top"><a href="https://www.facebook.com/pages/Selections-Warehouse/161945277215671" title="fb"><img src="../Ref/image_4604455.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td> </tr> </table> <div align="center"></div></td> </tr> </table> </div> </div> </body> </html> EOD; echo "$theResults"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/273897-php-servey-form-help/ Share on other sites More sharing options...
requinix Posted February 1, 2013 Share Posted February 1, 2013 1. PHPFreaks.com Questions, Comments, & SuggestionsThis is NOT a help forum! Do not post topics asking for help not related to the website. 2. When posting code, use or [code=php:0] tags. 3. Where's the ? Quote Link to comment https://forums.phpfreaks.com/topic/273897-php-servey-form-help/#findComment-1409460 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.
× 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.