Jump to content

mail form wrong???


soulroll

Recommended Posts

hi, please have a look on this, i tryed now the 3rd time to use a different code...but this one doesnt send too...i go crazy...can it be that hard to make a contact form?????????

 

here the html code:

</div>
	</div>
		<div class="col_2">
			<div class="indent">
			  <form method="POST" action="contact.php">
			   <p>
			     <input type="text" name="Name">
Name<br />
<br>
<input type="text" name="Position">
Position<br />
<br>
<input type="text" name="Business_Name">
Business Name<br />
<br>
<input type="text" name="Business_Adress">
Business Adress<br />
<br>
<input type="text" name="Business_Phone">
Business Phone<br />
<br>
<input type="text" name="Business_Web">
Business Web<br />
<br>
<input type="text" name="Email">
Email<br />
<br>
<input type="text" name="Nr._of_books">
Nr. of books
			   <br />
			   <p>Method of payment:
			     <br />
			     DirectFundsTransfer:<br />
	             <input type="checkbox" name="DirectFundsTransfer" value="Yes" />
	             <br />
	             Cheque:                   
                 <br />
                 <input type="checkbox" name="Cheque" value="Yes" />
			     <br />
			   CreditCard:
			   <br />
			   <input type="checkbox" name="CreditCard" value="Yes" />
			   <br>
                   <input type="submit" name="submit" value="Submit">                   				   

		      </form>
			</div>
		</div>

 

and here the php:

<?php


// get posted data into local variables
$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "bookorder";
$Name = Trim(stripslashes($_POST['Name'])); 
$Position = Trim(stripslashes($_POST['Position'])); 
$Business_Name = Trim(stripslashes($_POST['Business_Name'])); 
$Business_Adress = Trim(stripslashes($_POST['Business_Adress'])); 
$Business_Phone = Trim(stripslashes($_POST['Business_Phone'])); 
$Business_Web = Trim(stripslashes($_POST['Business_Web'])); 
$Email = Trim(stripslashes($_POST['Email'])); 
$Nr._of_books = Trim(stripslashes($_POST['Nr._of_books'])); 
$DirectFundsTransfer = Trim(stripslashes($_POST['DirectFundsTransfer'])); 
$Cheque = Trim(stripslashes($_POST['Cheque'])); 
$CreditCard = Trim(stripslashes($_POST['CreditCard'])); 

// validation
$validationOK=true;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Position: ";
$Body .= $Position;
$Body .= "\n";
$Body .= "Business_Name: ";
$Body .= $Business_Name;
$Body .= "\n";
$Body .= "Business_Adress: ";
$Body .= $Business_Adress;
$Body .= "\n";
$Body .= "Business_Phone: ";
$Body .= $Business_Phone;
$Body .= "\n";
$Body .= "Business_Web: ";
$Body .= $Business_Web;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Nr._of_books: ";
$Body .= $Nr._of_books;
$Body .= "\n";
$Body .= "DirectFundsTransfer: ";
$Body .= $DirectFundsTransfer;
$Body .= "\n";
$Body .= "Cheque: ";
$Body .= $Cheque;
$Body .= "\n";
$Body .= "CreditCard: ";
$Body .= $CreditCard;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>

 

 

dont know why its not sending????? been trying for weeks to get this to work...

Link to comment
https://forums.phpfreaks.com/topic/121386-mail-form-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.