mitle Posted October 12, 2010 Share Posted October 12, 2010 Hi im having trouble with attaching a posted array to my email script. Here is the code... //Form Snippet <td align="right" valign="top">Holes</td><td align="left"><select name="holes[]" size="9" multiple><option value="none" selected="selected">None</option><option value="Top Middle">Top Middle</option><option value="Left Middle">Left Middle</option><option value="Bottom Middle">Bottom Middle</option><option value="Right Middle">Right Middle</option><option value="Top Left">Top Left</option><option value="Top Right">Top Right</option><option value="Bottom Left">Bottom Left</option><option value="Bottom Right">Bottom Right</option></select> //End Form Snippet <?php$ip = $_POST['ip'];$httpref = $_POST['httpref'];$httpagent = $_POST['httpagent'];$company = $_POST['company'];$abn = $_POST['abn'];$email = $_POST['email'];$name = $_POST['name'];$phone = $_POST['phone'];$size = $_POST['size'];$material = $_POST['material'];$rounded = $_POST['rounded'];$holes=$_POST['holes'];$background = $_POST['background'];$print = $_POST['print'];$quantity = $_POST['quantity'];if (eregi('http:', $notes)) {die ("Html not allowed in forms.");}if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))){echo "<h2>Use Back - Enter valid e-mail</h2>\n";$badinput = "<h2>Feedback was NOT submitted</h2>\n";echo $badinput;die ("Go back! ! ");}if(empty($name) || empty($email) || empty($company )) {echo "<h2>Use Back - fill in all s</h2>\n";die ("Use back! ! ");}$todayis = date("l, F j, Y, g:i a") ;$attn = $attn ;$subject = $attn;$notes = stripcslashes($notes);$message = " $todayis [EST] \nFrom: $name ($email)\nCompany: $company \nABN: $abn \nEmail: $email \nName: $name \nPhone: $phone \nSize: $size \nMaterial: $material \nRounded Corners: $rounded \nHole Locations: $holes \n <<<<-Outputs text saying array or when $t posts blankBackground Colour: $background \nPrint Colour: $print \nQuantity: $quantity \nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref \n";$from = "From: $email\r\n";mail('example@hotmail.com', $subject = "Online - Custom Form Request", $message, $from);?> //HTML <html><h2>Your Order Details</h2><p>Thank You:</strong> <?php echo $name ?> ( <?php echo $email ?> ) <br />below is a copy of the Quote for a Custom Sign sent. We will get back to you as soon as possible.</p><p>Full Name:</strong> <?php echo $name ?> <br /><p>Company:</strong> <?php echo $company ?> <br /><p>ABN:</strong> <?php echo $abn?><br /><p>Email:</strong> <?php echo $email ?><br /><p>Phone Number:</strong> <?php echo $phone ?><br /><p>Size of sign:</strong> <?php echo $size ?><br /><p>Material:</strong> <?php echo $material ?><br /><p>Rounded Corners:</strong> <?php echo $rounded ?><br /><p>Hole Locations:</strong><br /><?phpif ($holes){foreach ($holes as $t){echo 'You selected ',$t,'<br />';}}?><br /><p>Background Colour:</strong> <?php echo $background ?><br /><p>Print Colour:</strong> <?php echo $print ?><br /><p>Quantity:</strong> <?php echo $quantity ?><br /><br/><br/><br/><br/><br/><br/>Your Ip Address is: <strong><?php echo $ip ?></strong> which has been recorded for security reasons.</p></html> //End HTML The Array posts fine when showing the results but adding it to the email send script i cant figure out. Any help would be greatly appreciated. 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.