phpforsilk Posted June 10, 2008 Share Posted June 10, 2008 Hi there, I've created a form in a PHP site and used a "FormToEmail.php" script from the web but I cannot get the contents of the form to email. Can someone help me? I'm not sure if I'm supposed to insert all of my code here so I'll wait to see what the response is. Thanks so much. SiLK Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/ Share on other sites More sharing options...
hansford Posted June 10, 2008 Share Posted June 10, 2008 The way it works here is: first you ask a question and post along with any relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562207 Share on other sites More sharing options...
phpforsilk Posted June 10, 2008 Author Share Posted June 10, 2008 OK, thanks....here goes.....sorry it's so long... The form code is: <form action="FormToEmail.php" method=POST class="style9"> <p align="left" class="style1"><strong>PCB Layout Quote Form </strong></p> <table border="1" cellspacing="0" cellpadding="0" width="550"> <tr> <td colspan="2" class="olderbluetext"><span class="style1 olderbluetext"><strong><span class="olderbluetext style1">Contact Information</span></strong></span></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">First Name * (required) </p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="FirstName"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Last Name * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="LastName"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Company Name * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="CompanyName"> </p></td> </tr> <tr> <td rowspan="2" valign="top" class="olderbluetext"><p align="left" class="style1">Address * </p></td> <td valign="top" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="Add1"> </p></td> </tr> <tr> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="Add2"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">City * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="City"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Province/State * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="City"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Country * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="20" NAME="Zip"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Postal/Zip Code</p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="20" NAME="Zip"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Telephone * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="33" NAME="TelAreaCode"> <br> Ext. <INPUT TYPE="TEXT" SIZE="5" NAME="TelExt"> </p> </td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">Fax </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="40" NAME="FaxAreaCode"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">E-Mail * </p></td> <td class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="40" NAME="email"> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">How would you like us to contact you? * </p></td> <td class="olderbluetext"><p class="style1"> <SELECT NAME="ContactClientVia[]" multiple" class=""> <OPTION SELECTED VALUE="Telephone">Telephone <OPTION VALUE="E-Mail">E-Mail <OPTION VALUE=" "> </SELECT> </p></td> </tr> <tr> <td class="olderbluetext"><p align="left" class="style1">How did you hear about us? </p></td> <td class="olderbluetext"><p class="style1"> <SELECT NAME="FoundUsBy[]" multiple" class=""> <OPTION VALUE="Referal">Referral <OPTION VALUE="Search Engine">Fidus representative <OPTION SELECTED VALUE="Banner Ad"> Search Engine <OPTION VALUE="Advertising">Advertising <OPTION VALUE=" news/article"> news/article <OPTION VALUE=" Event"> Event <OPTION VALUE=" Other"> Other </SELECT> </p></td> </tr> </table> <table border="1" cellspacing="0" cellpadding="0" width="550"> <tr> <td colspan="2" class="olderbluetext"><strong><br> <span class="style1">PCB Layout/Design</span></strong></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Planned Project Start Date * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> dd <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> mm <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> yyyy </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Planned Completion Date</p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> dd <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> mm <INPUT TYPE="TEXT" SIZE="5" NAME="EMail2"> yyyy </p></td> </tr> <tr> <td colspan="2" class="olderbluetext"><p align="left" class="style1"><strong><br> Project Information<br> <br> </strong> </p></td> </tr> <tr> <td width="278" valign="top" class="olderbluetext"><p align="left" class="style1">Project Scope (Select One)</p></td> <td width="266" valign="bottom" class="olderbluetext"><span class="style1"> <INPUT TYPE="checkbox" NAME="FormTech3" VALUE="SIMM/DIMM"> New Design <INPUT TYPE="checkbox" NAME="FormTech3" VALUE="AGP"> Redesign </span></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Board Name </p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="30" NAME="BoardName"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Number of Pins *</p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="4" NAME="Pins"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Number of Components * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="4" NAME="Parts"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Number of Nets * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="4" NAME="Nets"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Please attach a soft copy of schematics </p></td> <td width="266" class="olderbluetext"><p class="style1"> <input type="file" name="file"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Will you provide PCB layout guidelines? </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="GeneralPCBSuggestions" class=""> <OPTION VALUE="25">Yes <OPTION SELECTED VALUE="0">No </SELECT> <input type="file" name="file2"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Will you provide mechanical details? </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="ConnectorPCBSuggestions" class=""> <OPTION SELECTED VALUE="0">Yes <OPTION VALUE="25">No </SELECT> <input type="file" name="file3"> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Will you provide a Preliminary Placement? </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="PlacementAdder" class=""> <OPTION SELECTED VALUE="0">Yes <OPTION VALUE="25">No </SELECT> <input type="file" name="file4"> </p></td> </tr> </table> <table border="1" cellspacing="0" cellpadding="0" width="550"> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Required PCB Layout Tool?</p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="Layout Tool" class=""> <OPTION SELECTED VALUE="Allegro 15.5.1">Allegro 15.5.1 <OPTION VALUE="Allegro 15.7">Allegro 15.7 <OPTION VALUE="Allegro 16.1">Allegro 16.1 <OPTION VALUE="PADS">PADS <OPTION VALUE="Altium">Altium <OPTION VALUE="PCAD">PCAD <OPTION VALUE="Other">Other, please specify </SELECT> <br> If Other, specify: <input type="TEXT" size="20" name="OtherBoardThickness2"> <br> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Board Thickness </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="BoardThickness" class=""> <OPTION SELECTED VALUE=".062">.062 (Typical PCB) <OPTION VALUE=".018">.018 <OPTION VALUE=".031">.031 (Typical PCMCIA) <OPTION VALUE=".047">.047 <OPTION VALUE=".093">.093 (Typical VME) <OPTION VALUE=".125">.125 (Typical Back Plane) <OPTION VALUE="Other">Other, please specify </SELECT> inches<br> If Other, specify: <INPUT TYPE="TEXT" SIZE="20" NAME="OtherBoardThickness"> inches </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Number of Layers * </p></td> <td width="266" class="olderbluetext"><textarea name="textarea" cols="30" rows="3"></textarea></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Signal Layer Count * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <textarea name="textarea2" cols="30" rows="3"></textarea> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Board Size</p></td> <td width="266" class="olderbluetext"><p class="style1"> <INPUT TYPE="TEXT" SIZE="10" NAME="OtherBoardThickness"> x <INPUT TYPE="TEXT" SIZE="8" NAME="OtherBoardThickness"> <INPUT TYPE="checkbox" NAME="FormTech" VALUE="PCMCIA"> in <INPUT TYPE="checkbox" NAME="FormTech" VALUE="PCMCIA"> cm</p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Board Type </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="BoardType" class=""> <OPTION VALUE="Single Board">Single Board <OPTION VALUE="2 Boards" selected>2 Boards <OPTION VALUE="3 Boards">3 Boards </SELECT> (not required) <br> <input type="text" name="textfield3"> <br> <br> </p> </td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Component Geometry </p></td> <td width="266" class="olderbluetext"><p class="style1"> <select name="ComponentGeo" class=""> <option value="Leaded, one side">Through hole , one side <option value="Leaded, both sides">Through hole , both sides <option value="SMD, one side">SMD, one side <option value="SMD, both sides">SMD, both sides <option value="SMD one side, opposite side leaded">SMD one side, opposite side Through hole <option value="SMD one side, same side leaded">SMD one side, same side Through hole <option selected value="SMD both sides, leaded one side">SMD both sides, Through hole one side <option value="SMD both sides, leaded both sides">SMD both sides, Through hole both sides <option value="BGA">BGA <option value="Flip Chip">Flip Chip <option value="Die Bond">Die Bond </select> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Functional Test Points? </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="FuncTestPoints" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes, Top and Bottom">Yes, Top & Bottom <OPTION VALUE="Yes, Top Only">Yes, Top Only <OPTION VALUE="Yes, Bottom Only">Yes, Bottom Only </SELECT> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">In-Circuit Test Points? * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="ICTPoints" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes, Top and Bottom, Up to 100%">Yes, Top & Bottom, Up to 100% <OPTION VALUE="Yes, Top Only, Up to 100%">Yes, Top Only, Up to 100% <OPTION VALUE="Yes, Bottom Only, Up to 100%">Yes, Bottom Only, Up to 100% <OPTION VALUE="Yes, Top and Bottom, 100% Only">Yes, Top & Bottom, 100% Only <OPTION VALUE="Yes, Top Only, 100% Only">Yes, Top Only, 100% Only <OPTION VALUE="Yes, Bottom Only, 100% Only">Yes, Bottom Only, 100% Only </SELECT> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Special Design Guidelines? * </p></td> <td width="266" class="olderbluetext"><p class="style1"> <select name="select3" class=""> <option selected value="No">No <option value="Yes">Yes </select> Description <textarea name="OtherBoardThickness" cols="40" rows="5"></textarea> </p> <p class="style1"> <input type="file" name="file5"> </p></td> </tr> <tr> <td class="olderbluetext style1">Blind/Buried/Micro Vias?</td> <td class="olderbluetext"><SELECT NAME="blindburiedmicrovias" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Electronics Assembly Standards</p></td> <td width="266" class="olderbluetext"><p class="style1">IPC <INPUT TYPE="TEXT" SIZE="20" NAME="OtherBoardThickness"> <br> Class <INPUT TYPE="TEXT" SIZE="20" NAME="OtherBoardThickness"> <br> Level <INPUT TYPE="TEXT" SIZE="20" NAME="OtherBoardThickness"> <br> Other <INPUT TYPE="TEXT" SIZE="20" NAME="OtherBoardThickness3"> </p> </td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">EMI Shielding?</p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="SpecialDesignGuidelines" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">BGA Pin spacing < 1mm?</p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="SpecialDesignGuidelines" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">BGA or Other Device Sockets?</p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="SpecialDesignGuidelines" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT> </p></td> </tr> <tr> <td width="278" class="olderbluetext"><p align="left" class="style1">Via Stitching?</p></td> <td width="266" class="olderbluetext"><p class="style1"> <SELECT NAME="SpecialDesignGuidelines" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT> </p></td> </tr> </table> <table border="1" cellspacing="0" cellpadding="0" width="550"> <tr> <td width="278"><p align="left" class="style1">Heat Sinking Required?</p></td> <td width="266"><p class="style1"> <SELECT NAME="select" class=""> <OPTION SELECTED VALUE="No">No <OPTION VALUE="Yes">Yes </SELECT> <br> Please specify <input type="text" name="textfield2"> </p></td> </tr> <tr> <td colspan="2"><table width="100%" border="0" align="center" cellpadding="0"> <tr> <td colspan="2"><div align="center" class="style1"> <div align="left"><strong><br> Routing Technology - Check all that apply </strong></div> </div></td> </tr> <tr> <td width="49%"><span class="style1"> <INPUT TYPE="checkbox" NAME="Controlled Impedance" VALUE="Yes"> Controlled Impedance </span></td> <td width="51%" valign="bottom"><p class="style1"> <INPUT TYPE="checkbox" NAME="High Speed Digital" VALUE="Yes"> High Speed Digital (> 100 MHz) </p></td> </tr> <tr> <td width="49%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Differential_Pairs" VALUE="Yes"> Differential Pairs </p></td> <td width="51%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Digital" VALUE="Yes"> Digital (> 3 GHz)</p></td> </tr> <tr> <td width="49%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Matched Line Lengths" VALUE="Yes"> Matched Line Lengths </p></td> <td width="51%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Analog" VALUE="Yes"> Analog </p></td> </tr> <tr> <td width="49%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Mil-Std-xxx" VALUE="Yes"> Military Standard </p></td> <td width="51%"><p class="style1"> <INPUT TYPE="checkbox" NAME="Radio Frequency" VALUE="Yes"> Radio Frequency </p></td> </tr> <tr> <td width="49%"><p class="style1"> <INPUT TYPE="checkbox" NAME="High Voltage" VALUE="Yes"> High Voltage </p></td> <td width="51%"><p class="style1"> </p></td> </tr> </table> </div></td> </tr> <tr> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td colspan="3" class="style1"><div align="center"> <p align="left"><strong><br> Interconnect Technology - Check all that apply </strong></p> </div></td> </tr> <tr> <td width="33%" class="style1"><input type="checkbox" name="FormTech2" value="Custom Design"> Custom Design </td> <td width="33%" valign="bottom" class="style1"><p> <input type="checkbox" name="FormTech2" value="PCMCIA"> PCMCIA </p></td> <td width="33%" valign="bottom" class="style1"><p> <input type="checkbox" name="FormTech2" value="VME 3U 6U 9U"> VME 3U 6U 9U </p></td> </tr> <tr> <td width="33%" class="style1"><p> <input type="checkbox" name="FormTech2" value="ISA 8 / 16 Bit PC Bus"> ISA 8 / 16 Bit PC Bus </p></td> <td width="33%" class="style1"><p> <input type="checkbox" name="FormTech2" value="PCI Bus"> PCI Bus </p></td> <td width="33%" class="style1"><p> <input type="checkbox" name="FormTech2" value="SIMM/DIMM"> SIMM/DIMM </p></td> </tr> <tr> <td class="style1"><input type="checkbox" name="FormTech24" value="High-Speed Backplanes"> High-Speed Backplanes</td> <td class="style1"><input type="checkbox" name="FormTech23" value="PC-104"> PC-104 </td> <td class="style1"><input type="checkbox" name="FormTech22" value="AGP"> PCI Express </td> </tr> <tr> <td colspan="3" class="style1"><p>Other <input type="text" name="textfield"> </td> </tr> </table> </div></td> </tr> <tr> <td colspan="2" class="olderbluetext"><p align="left" class="style1"><strong><br> Design Deliverables -- Check all that apply </strong> </p></td> </tr> <tr> <td width="278" valign="top" class="olderbluetext"><p class="style1"> <INPUT TYPE="checkbox" NAME="DeliverFabDrawing" VALUE="Yes"> Fabrication Package<br> <INPUT TYPE="checkbox" NAME="DeliverFabDrawing" VALUE="Yes"> Fabrication Drawing<br> <INPUT TYPE="checkbox" NAME="DeliverGBR/DrillFiles" VALUE="Yes"> Gerber and Drill Files<br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop" VALUE="Yes"> Assembly Drawing, Top (PDF or DXF)<br> <input type="file" name="file9"> <br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingBottom" VALUE="Yes"> Assembly Drawing, Bottom (PDF file)<br> <input type="file" name="file10"> <br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop" VALUE="Yes"> Silk Screen<br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop" VALUE="Yes"> Test Point NC Data<br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop3" VALUE="Yes"> NC Route Data<br> <input type="checkbox" name="DeliverAssemblyDrawingTop22" value="Yes"> IPC-D-356 Export<br> <input type="checkbox" name="DeliverAssemblyDrawingTop222" value="Yes"> Fabrication Drawing (PDF or DXF) <input type="file" name="file8"> <br> </p> <p class="style1"> </p></td> <td width="266" valign="top" class="olderbluetext"><p class="style1"><INPUT TYPE="checkbox" NAME="DeliverBOM" VALUE="Yes"> BOM <input type="file" name="file6"> <br> <INPUT TYPE="checkbox" NAME="DeliverCheckPlots" VALUE="Yes"> Check Plots<br> <INPUT TYPE="checkbox" NAME="DeliverArchiveSet" VALUE="Yes"> Archive Set<br> <INPUT TYPE="checkbox" NAME="DeliverArchiveSetCD" VALUE="Yes"> Archive Set on FTP site<br> <INPUT TYPE="checkbox" NAME="DeliverArchiveSetCD" VALUE="Yes"> Valor extract files (ODB++)<br> <INPUT TYPE="checkbox" NAME="DeliverArchiveSetCD" VALUE="Yes"> Signal Integrity Report<br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop2" VALUE="Yes"> Placement Data<br> <INPUT TYPE="checkbox" NAME="DeliverAssemblyDrawingTop23" VALUE="Yes"> Datasheet <input type="file" name="file7"> <br> </p> </td> </tr> </table> <table border="1" cellspacing="0" cellpadding="0" width="550"> <tr> <td width="546"><p><span class="maintextcell style1"><strong>Additional Project Details</strong> </span><br> <TEXTAREA NAME="DesignNotes" COLS="65" ROWS="9"></TEXTAREA> </p></td> </tr> </table> <p> <input type="submit" name="Submit" value="Submit"></form> THEN THE FORMTOEMAIL CODE is: <?php $my_email = "sarah@silkwebsolutions.com"; $errors = array(); // Remove $_COOKIE elements from $_REQUEST. if(count($_COOKIE)){foreach(array_keys($_COOKIE) as $value){unset($_REQUEST[$value]);}} // Validate email field. if(isset($_REQUEST['email']) && !empty($_REQUEST['email'])) { $_REQUEST['email'] = trim($_REQUEST['email']); if(substr_count($_REQUEST['email'],"@") != 1 || stristr($_REQUEST['email']," ")){$errors[] = "Email address is invalid";}else{$exploded_email = explode("@",$_REQUEST['email']);if(empty($exploded_email[0]) || strlen($exploded_email[0]) > 64 || empty($exploded_email[1])){$errors[] = "Email address is invalid";}else{if(substr_count($exploded_email[1],".") == 0){$errors[] = "Email address is invalid";}else{$exploded_domain = explode(".",$exploded_email[1]);if(in_array("",$exploded_domain)){$errors[] = "Email address is invalid";}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match('/^[a-z0-9-]+$/i',$value)){$errors[] = "Email address is invalid"; break;}}}}}} } // Check referrer is from same site. if(!(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){$errors[] = "You must enable referrer logging to use the form";} // Check for a blank form. function recursive_array_check_blank($element_value) { global $set; if(!is_array($element_value)){if(!empty($element_value)){$set = 1;}} else { foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);} } } recursive_array_check_blank($_REQUEST); if(!$set){$errors[] = "You cannot send a blank form";} unset($set); // Display any errors and exit if errors exist. if(count($errors)){foreach($errors as $value){print "$value<br>";} exit;} if(!defined("PHP_EOL")){define("PHP_EOL", strtoupper(substr(PHP_OS,0,3) == "WIN") ? "\r\n" : "\n");} // Build message. function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");} $message = build_message($_REQUEST); $message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."Thank you"; $message = stripslashes($message); $subject = "PCB Layout Quote Request"; $headers = "From: " . $_REQUEST['email']; $headers .= PHP_EOL; $headers .= "Return-Path: " . $_REQUEST['email']; $headers .= PHP_EOL; $headers .= "Reply-To: " . $_REQUEST['email']; mail($my_email,$subject,$message,$headers); <b>Thank you <?php print stripslashes($_REQUEST['FirstName']); ?></b> <div align="center"><br> Your form has been submitted </div> <p align="center"><a href="<?php print $continue; ?>">Click here to return to the Fidus homepage</a></p> Please use tags when posting code. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562220 Share on other sites More sharing options...
revraz Posted June 10, 2008 Share Posted June 10, 2008 The best way to trouble shoot mail issues is to make it simple. Create a new php file, with one line of code, the mail() function. Use required parameters to get it to send then go from there. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562224 Share on other sites More sharing options...
hansford Posted June 10, 2008 Share Posted June 10, 2008 using the mail function in php is not the way to go IMO. the recipients mail server can view it as spam and just filter it out. PHPMailer works great. You just use your smtp settings from your hosted account. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562252 Share on other sites More sharing options...
phpforsilk Posted June 10, 2008 Author Share Posted June 10, 2008 Thanks for the quick response. I am a true rookie at PHP, do you think you could explain how I do this? Thank you... Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562267 Share on other sites More sharing options...
hansford Posted June 10, 2008 Share Posted June 10, 2008 download the script. It has instructions for installing. http://sourceforge.net/projects/phpmailer Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562286 Share on other sites More sharing options...
revraz Posted June 10, 2008 Share Posted June 10, 2008 And if you want to try what you already have, create a new php file and use <?php mail("my_email@domain.com","subject","message","FROM: my_email@domain.com"); ?> Replace the my_email@domain.com with your real email. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-562290 Share on other sites More sharing options...
phpforsilk Posted June 11, 2008 Author Share Posted June 11, 2008 So I've tried to create a new file as instructed but the email still doesn't go. I've downloaded phpmailer, but I don't understand the php.ini file as the site that I'm working on doesn't have this file. Can someone please look at my code and explain what I have to enter in order for all the elements of the form to be sent via email? Thanks so much. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-563366 Share on other sites More sharing options...
revraz Posted June 11, 2008 Share Posted June 11, 2008 Is it a shared webhost? If so, ask them what you need to do to send mail. Each server will have a php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/109599-help-with-a-form/#findComment-563371 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.