0

Can someone tell me why the print is not showing up on the page and the email is not be sent to the receipient with the information. HELP

<?php

if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>



<h5>Vairalbe Information to be Embossed</h5>

<form id="frm_message" name="frm_message" method="post" action="<?php echo $PHP_SELF;?>">

<fieldset>
<input type="hidden" name="subject" value="Varialbe Information to be Embosssed" />

		<ul>
        		<li>

				<label class="description" for="Subject">Subject: </label>
				
		    Vairalbe Information to be Embossed </li>		
			<li>

				<label class="description" for="Company">Company: </label>
				
					<input name="Name" id="company" type="text" size="45" class="element text" value="" />
					
				

			</li>

			<li>
				<label class="description" for="contactPerson">Contact Person: </label>
			
					<input name="contact" id="contact" type="text" size="45" class="element text" value="" />
		


			</li>
            <li>
				<label class="description" for="phoneNumber">Phone Number: </label>
			
					<input name="phone" id="phone" type="text" size="25" class="element text" value="" />
		


			</li>

			<li>
				<label class="description" for="email">Email: <span class="required">*</span></label>
				
					<input name="email" id="email" type="text" class="element text" size="45" value="" />
	<p class="error hidden" id="err_email"></p>
			</li>
 	
			<li>
          

				<label class="description" for="line1">Line 1: </label>
				
					<input name="line1" id="line1" type="text" size="25" maxlength="25" class="element text" value="" />
					
				

			</li>

			<li>
				<label class="description" for="line2">Line 2: </label>
			
					<input name="line2" id="line2" type="text" size="25" class="element text" maxlength="25" value="" />
		


			</li>
            <li>
				<label class="description" for="line3">Line 3: </label>
			
					<input name="line3" id="Line3" type="text" size="25" class="element text" maxlength="25" value="" />
		


			</li>

			<li>
				<label class="description" for="Line4">Line 4: </label>
				
					<input name="line4" id="line4" type="text" class="element text" size="25" maxlength="25"  value="" />
	
			</li>
            <li>
				<label class="description" for="Line5">Line 5: </label>
				
					<input name="line5" id="line4" type="text" class="element text" size="25" maxlength="25" value="" />
	
			</li>
          </ul>        
</fieldset>

<fieldset>
  <ul>
    

    
    <li>
 <input name="Submit" type="submit" value="Submit" />
 
  
 
      
    </li>
  </ul>
</fieldset>

</form>


<?
      } else {
      error_reporting(0);
     $Subject = $_POST["Subject"];
$Name = $_POST["Name"];
$contact = $_POST["contact"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$line1 = $_POST["line1"];
$line2 = $_POST["line2"];
$line3 = $_POST["line3"];
$line4 = $_POST["line4"];
$line5 = $_POST["line5"];
$recipient = 'lorenwtaylor@gmail.com';
      if (mail($recipient, $subject, $Name, $contact, $phone, $line1, $line2, $line3, $line4, $line5))
        echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
        ");
	 else
         echo "Message failed to send";
}
?>

Edited by nav33n: Please use [code][/code] tags to wrap your code for easy readability.

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by fizanos
0

You're using the mail function incorrectly.

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

her are some examples of correct headers (from php.net docs):

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

You're trying to place text in email headers & parameters. Place all your text in one variable & do this.

mail($recipient, $subject, $message);

Edited by Onisutra: n/a

0

Try

<input type="button" class="goZ"  onClick="javascript:print(document);" onKeyPress="javascript:print(document);" value="Click Here To Print">

for the print

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.