Link to home
Start Free TrialLog in
Avatar of Leroice
Leroice

asked on

Can I get a multi line input box to display as bullet points in return email?

HI guys I have a form located at

http://www.blueprintcatering.com.au/OnlineCateringRequestTest.php

that has an input box for "FOOD REQUIRED" and "BEVERAGE REQUIRED". Everything is working great, but my client wants the email to return the values in a listed, bullet point style.

I have attached the images of what the input and return look like and also how it needs to look at the end. Also the code for the entire form is there as well.

I am a noob so I'm a bit baffled by it all but I'm starting to get the hang of it.

Thanks for your help,

Leroice
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Blueprint Catering - Catering Request Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css.css" rel="stylesheet" type="text/css" />
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="imagetoolbar" content="false">
<style type="text/css">
<!--
.style2 {font-size: 12px}
-->
</style>
</head>


<body>
<div id="long"></div>
<div id="main">
<br>
<br>
<div id="logo"></div>
<br>
<br>
<div id="catering_request_img"></div>
<div id="side"></div>

<div id="catering_request">
  <?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
<br>
<br>
Complete the Catering Request Form below to place your order online.
<br>
<a href="http://www.blueprintcatering.com.au/Data/BlueprintCateringMenu.pdf" target="_blank">CLICK HERE to launch our full menu in a new window</a>
<br>
<br>
After completing the form you will be contacted by Blueprint Catering with a quotation.</div>
<br>
<form name="form1" method="post" action="<?php echo $me; ?>">
  
<br>
<img src="images/your_details.png">
<br>
<table width="591" height="138" border="0" cellpadding="1" cellspacing="0">
				<br>
                <tr> 
       		    <td width="189"><div align="right" class="style2">Name:*</div></td> 
	  			<td width="402"><input name="name" type="text" id="name" size="50"></td>
				</tr>

   			    <tr> 
                <td width="189"><div align="right" class="style2">Company/Faculty:*</div></td>                  
                <td width="402"><input name="company_faculty" type="text" id="company_faculty" size="50"></td>
    			</tr>
    
                <tr> 
                <td width="189"><div align="right" class="style2">Phone:*</div></td>
                <td width="402"><input name="phone" type="text" id="phone" size="50"></td>
    			</tr>
                
                <tr> 
                <td width="189"><div align="right" class="style2">Fax:*</div></td>
                <td width="402"><input name="fax" type="text" id="fax" size="50"></td>
    			</tr>
                
                <tr> 
                <td width="189"><div align="right" class="style2">Email:*</div></td>
                <td width="402"><input name="email" type="text" id="email" size="50"></td>
    			</tr>
                
                <tr> 
                <td width="189"><div align="right" class="style2">Invoicing Address:*</div></td>
                <td width="402"><input name="invoicing_address" type="text" id="invoicing_address" size="50"></td>
    			</tr>
                 
                <tr>
                <td width="189"><div align="right" class="style2">Accounts Payable Contact:*</div></td>
                <td width="402"><input name="accounts_payable" type="text" id="accounts_payable" size="50"></td>
                </tr>
</table>

<br>
<img src="images/food_details.png">
<br>
<table width="537" border="0" cellpadding="1" cellspacing="0">
				<tr> 
       		    <td width="189"><div align="right" class="style2">
       		    Function Type:<br>
                Please select one option</div></td> 
				<td width="83"><div align="center" class="style2"><input type="radio" name="function_type" value="Breakfast"/>
                <br>Breakfast</div></td>
				<td width="94"><div align="center" class="style2"><input type="radio" name="function_type" value="Morning Tea"/>
                <br>Morning Tea</div></td>
				<td width="61"><div align="center" class="style2"><input type="radio" name="function_type" value="Lunch"/>
              	<br>Lunch</div></td>
				<td width="100"><div align="center"  class="style2"><input type="radio" name="function_type" value="Afternoon Tea"/>
      			<br>Afternoon Tea</div></td>
    			</tr>
                
                <tr>
                <td>
                <br>                
                </td>
                </tr> 
                
                <tr>
       		    <td width="189"><br></td>
                <br>
                <td width="83"><div align="center" class="style2"><input type="radio" name="function_type" value="Tea / Coffee">
                <br>Tea & Coffee</div></td>
                <td width="94"><div align="center"  class="style2"><input type="radio" name="function_type" value="Cocktail Party">
                <br>Cocktail Party</div></td>
                <td width="61" ><div align="center" class="style2"><input type="radio" name="function_type" value="Other">
                <br>Other</div></td>   
    			</tr>
</table>                
           
<table width="591" height="30" border="0" cellpadding="1" cellspacing="0">
	
                
				<tr>
       		    <td width="189" height="30"><div align="right" class="style2">Function Date:</div></td> 
	  			<td width="111"><input name="function_date" type="text" id="function_date" size="10"></td>
       		    <td width="158"><div align="right" class="style2">Function Time:</div></td> 
	  			<td width="124"><input name="function_time" type="text" id="function_time" size="10"></td>
				</tr>
</table>

<table width="645" border="0" cellpadding="1" cellspacing="0">

	   			<tr> 
      		    <td width="189"><div align="right" class="style2">Food Required:<br>
                Please hit enter after each item<br>
                Please enter quantities</div></td> </td>
	   			<td width="452"><textarea name="food_required" cols="47.5" rows="10" wrap="physical" id="food_required"></textarea></td>
    			</tr>

			    <tr> 
        		<td width="189"><div align="right" class="style2">Beverages Required:<br>
                Please hit enter after each item<br>
                Please enter quantities</div></td> 
	    		<td width="452"><textarea name="beverages_required" cols="47.5`" rows="10" wrap="physical" id="beverages_required"></textarea></td>
				</tr>
     
			    <tr> 
        		<td width="189"><div align="right" class="style2">Guest Numbers:</div></td> 
	    		<td width="452"><input name="guest_numbers" type="text" id="guest_numbers" size="10"></td>
    			</tr>
</table>       


<table width="591" border="0" cellpadding="1" cellspacing="0">

				<tr>
        		<td width="189" height="38"><div align="right" class="style2">
     			 Do you require staff?:</div></td>
           		<td width="60"><div align="center" class="style2">
                <input type="radio" name="staff" value="Yes Staff Required">
      			<br>Yes</div></td>
      			
	  			<td width="60"><div align="center" class="style2">
	            <input type="radio" name="staff" value="No Staff Required">
	            <br>No</div></td>
                
                <td width="148"><div align="right" class="style2">
                If Yes, how many?</div></td>
      
                <td width="124"><input name="staff_how_many" type="text" id="staff_how_many" size="10"></td>
				</tr>
</table>

<br>
<img src="images/delivery_pickup.png">
<br>

<table width="591" border="0" cellpadding="1" cellspacing="0">
                
				<tr>
                <td width="188"><div align="right" class="style2">
                 Will you require delivery?:
      			</div></td>
				
                <td width="59"><div align="center">
                <input type="radio"  name="delivery" value="Yes Delivery Required">
                <br>
                <span class="style2">Yes</span></div></td>
				
                <td width="59"><div align="center">
                <input type="radio" name="delivery" value="No Delivery Required">
     			<br>
     			<span class="style2">No</span></div></td>

				<td width="148"><div align="right" class="style2">
                Pick Up Time:
				<br>
				Between 6am -4pm</div></td>
                
      	       <td width="127"><input name="pick_up_time" type="text" id="pick_up_time" size="10"></td>
    		   </tr>               
</table>

<table width="591" height="100" border="0" cellpadding="1" cellspacing="0">
<tr> 
       		    <td width="189"><div align="right" class="style2">Delivery Address: </div></td> 
	  			<td width="402"><input name="delivery_address" type="text" id="delivery_address" size="50"></td>
				</tr>

   			    <tr> 
                <td width="189"><div align="right" class="style2">Preferred Delivery Time: </div></td>                  
                <td width="402"><input name="delivery_time" type="text" id="delivery_time" size="10"></td>
    			</tr>
                
                <tr> 
          	    <td width="189" height="25"><div align="right" class="style2">Delivery Contact Person: </div></td>                  
      			<td width="407"><input name="delivery_contact_person" type="text" id="delivery_contact_person" size="30"></td>
				</tr>
  
 </table>

<table width="595" height="40" border="0">              
		<tr>
	 			 <td>
                 <br>
      			   <div align="center">
      			     <input name="Submit" type="submit" id="submit" value="" border="0px">
        		   </div></td>
	  	</tr>
</table>
</form>

  
  
  <?php 
        } else { 
        error_reporting(0); 
        $errors = array(); 
        $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; 
        if (!ereg($page, $_SERVER['HTTP_REFERER'])) 
                $errors[] = "Invalid referer"; 
        if (!$_POST['name']) 
                $errors[] = "<h3>Name is required</h3>"; 
        if (!$_POST['company_faculty']) 
                $errors[] = "<h3>Company Faculty is required</h3>"; 
        if (!$_POST['phone']) 
                $errors[] = "<h3>Phone number is required</h3>";                 
        if (!$_POST['email']) 
                $errors[] = "<h3>Email is required</h3>"; 
        if (!$_POST['invoicing_address']) 
                $errors[] = "<h3>Invoicing Address is required</h3>"; 
        if (!$_POST['accounts_payable']) 
                $errors[] = "<h3>Accounts Payable Contact is required</h3>"; 
                           
        if (count($errors)>0) { 
                foreach($errors as $err) 
                echo "$err<br>\n"; 
                        echo "<br>Please use your browser's Back button to fix this problem."; 
        } else { 
            $recipient = 'leroice@mac.com';
			
        }
        
        
		 $subject = "Online Catering Request";
		 $header = "From: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\n";
		 $header .= "Reply-To: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\n";
		 $header .= "X-Mailer: PHP/" . phpversion() . "\n";
		 $header .= "X-Priority: 1";
         $from = stripslashes($_POST['name']);
      		         
         $msg.= "Message sent by $from\n";
				
				$msg = '<table border="0" bordercolor="0000FF">
				<br>
				<br>
				<img src="http://www.blueprintcatering.com.au/images/logo.png" alt="BLUEPRINT CATERING">
				<br>
				<br>
				<img src="http://www.blueprintcatering.com.au/images/catering_request_form.png" alt="BLUEPRINT CATERING">
				<br>
				<br>
				<img src="http://www.blueprintcatering.com.au/images/customer.png" alt="CUSTOMER DETAILS">
				
	
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Company / Faculty: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['company_faculty'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Phone: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['phone'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Email:</td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['email'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px>  Fax: </td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['fax'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px>  Function Date:</td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['function_date'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px>  Function Time:</td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['function_time'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px>  Function Type:</td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['function_type'].'</td>
	</tr>
</table>
	<img src="http://www.blueprintcatering.com.au/images/foodBev.png" alt="FOOD & BEVERAGE ORDER" />
	<table border="0" bordercolor="0000FF">
	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Food Required: </td>
		<td bgcolor="EEEEEE"; width=500px> <h3>'.$_POST['food_required'].'</h3></td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Beverages Required: </td>
		<td bgcolor="EEEEEE"; width=500px><h3>'.$_POST['beverages_required'].'</h3></td>
	</tr>
	</table>
		<table border="0" bordercolor="0000FF">
		<img src="http://www.blueprintcatering.com.au/images/staff.png" alt="STAFF & PICK UP" />
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Staff Required: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['staff'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Staff Numbers: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['staff_how_many'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Pick Up Time: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['pick_up_time'].'</td>
	</tr>
	</table>
	<table border="0" bordercolor="0000FF">
	<img src="http://www.blueprintcatering.com.au/images/deliveryDetails.png" alt="DELIVERY DETAILS">
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Delivery: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['delivery'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Preferred Delivery Time: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['delivery_time'].'</td>
	</tr>
	</table>
	<table border="0" bordercolor="0000FF">
	<br>
	<tr>
		<td bgcolor="A1DBFA"; width=180px> Delivery Address: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['delivery_address'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA" width=180px> Delivery Contact Person: </td>
		<td bgcolor="EEEEEE"; width=500px>'.$_POST['delivery_contact_person'].'</td>
	</tr>
	</table>
		<table border="0" bordercolor="0000FF">
		<img src="http://www.blueprintcatering.com.au/images/invoicing.png" alt="INVOICING & ACCOUNTS" />
	<tr>
		<td bgcolor="A1DBFA"; width=180px; > Invoicing Address: </td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['invoicing_address'].'</td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px; > Accounts Payable: </td>
		<td bgcolor="EEEEEE"; width=500px> '.$_POST['accounts_payable'].' </td>
	</tr>
</table>'
;
        $headers = "From: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\r\n"; 
        $headers .= "Reply-To: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\r\n"; 
        $headers .= "X-Mailer: PHP/" . phpversion() . "\n"; 
        $headers .= "X-Priority: 1\n"; 
        $headers .= 'MIME-Version: 1.0' . "\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

        if (mail($recipient,$subject,$msg,$headers)){ 
                echo "<p><br><br><h3>Thanks for your catering request.  We will get back to you shortly with a quote.</h3></p>"; 
				//echo ($msg);
		} else 
            echo "<br><br>An unknown error occurred.";
        }
?>
   
</div> 
</body> 
</html>

Open in new window

Input-Screen-Shot.png
Current-Return.png
How-it-needs-to-look.png
Avatar of hielo
hielo
Flag of Wallis and Futuna image


instead of:
	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Food Required: </td>
		<td bgcolor="EEEEEE"; width=500px> <h3>'.$_POST['food_required'].'</h3></td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Beverages Required: </td>
		<td bgcolor="EEEEEE"; width=500px><h3>'.$_POST['beverages_required'].'</h3></td>
	</tr>

try:

	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Food Required: </td>
		<td bgcolor="EEEEEE"; width=500px> <h3>'.str_replace("\n","<br>",$_POST['food_required']).'</h3></td>
	</tr>
	<tr>
		<td bgcolor="A1DBFA"; width=180px;> Beverages Required: </td>
		<td bgcolor="EEEEEE"; width=500px><h3>'.str_replace("\n","<br>",$_POST['beverages_required'])st.'</h3></td>
	</tr>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Leroice
Leroice

ASKER

Thanks for the sresponse

Will try it now
Avatar of Leroice

ASKER

Golden!!!


Thanks so much for that - worked perfectly

500 points to you.

Any chance of explaining the syntax at all?? Only if it's no trouble - Just trying to learn it.



Avatar of Leroice

ASKER

worked perfectly
on the textbox, those items appear one per line because there is newline character after each item. So, on the code I gave you I am simply replacing the newline character ("\n") with <li>.

Look up the str_replace() on the php.net site so you understand better what I did.
Avatar of Leroice

ASKER

Thanks a lot

Much  appreciated