Hi,
I am making php from.Everhting is working fine.I am receving result as below.I want to space before Tel no.Please be advice how i can do. Thank you.
---------------------------------------------------
Email Result
--------------------------------------------------
General Info Request
Name: Khan

1665 Bloor Street
Mississauga
L4X3T4
Tel:647-290-0000
Email: hanyon@gmail.com

Best Time To Contact:11am
Message is:
Hi,
---------------------------------------------------

<?php
$name=$_POST['name'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$contact_time=$_POST['Contact_Time'];
$address=$_POST['address'];
$city=$_POST['city'];
$postal=$_POST['postal'];
$message=$_POST['message'];
if($message=="")
{
$message="<b>no message</b>";
}
else
{
$message="<b>Message:</b><br>".$message;
}

$emailBody ="<HTML>\n"
."<head><title></title></head><body>\n"
."<table bordercolor=red border=\"1\" cellspacing=0 cellpadding=0>\n"
."<tr><td  bgcolor=\"#e9e8d6\"  colspan=2 align=center><h3>General Info Request</h3></td></tr>\n"

."<tr><td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Name:</b>$name</td>

<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b></b>$address</td>
<td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b></b>$city</td></tr>\n"
."<tr><td   bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\" colspan=2><b></b>$postal</td></tr>\n"


."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n"
."<tr><td  bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\"><b>Email:</b>$email</td>

<td   bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\"><b>Best Time To Contact:</b>$contact_time</td></tr>\n"

."<tr><td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\" colspan=2>$message</td></tr>\n"
."</table></body></html>";


$emailTo =  '"" <info@land.ca>'; //Enter your email instead of email@yourdomain.com
$emailSubject = "FREE DEMONSTRATION";
$emailSubject = preg_replace('/[\x00-\x1F]/', '', $emailSubject);

$emailFrom = $email;//from email
$emailFrom = preg_replace('/[\x00-\x1F]/', '', $emailFrom);
$emailHeader = "From: $emailFrom\n"
 . "Reply-To: $emailFrom\n"
 . "Return-Path: $emailFrom\n"
 . "X-Sender: $emailFrom\n"
 . "X-Mailer: PHP\n"
 . "X-Priority: 3\n"
 . "MIME-Version: 1.0\n"
 . "Content-Type: text/html; charset=\"ISO-8859-1\"\n"
 . "Content-Transfer-Encoding: base64\n"
 . "\n";
 $emailBody=chunk_split(base64_encode($emailBody));
 
 mail($emailTo, $emailSubject, $emailBody, $emailHeader);
 # Confirmation Email to User

$confEmailTo =$email;//from email
$confEmailTo = preg_replace('/[\x00-\x1F]/', '', $confEmailTo);

$confEmailSubject = "Confirmation ";
$confEmailSubject = preg_replace('/[\x00-\x1F]/', '', $confEmailSubject);

$confEmailBody = "Hello $fname,\n"
 . "Thanks for your recent enquiry . We have received your message, we will contact you shortly - Grout Masters\n"
 . "\n"
 . "";

$confEmailHeader = "From: no-reply@yourdomain.com\n"//Enter your email instead of email@yourdomain.com
 . "Reply-To: no-reply@yourdomain.com\n"//Enter your email instead of email@yourdomain.com
 . "MIME-Version: 1.0\n"
 . "Content-type: text/plain; charset=\"ISO-8859-1\"\n"
 . "Content-transfer-encoding: 8bit\n";

mail($confEmailTo, $confEmailSubject, $confEmailBody, $confEmailHeader);

 
header("location:thankyou.html");//reload






?>

Hi,
I am making php from.Everhting is working fine.I am receving result as below.I want to space before Tel no.Please be advice how i can do. Thank you.
---------------------------------------------------
Email Result
--------------------------------------------------
General Info Request
Name: Khan

1665 Bloor Street
Mississauga
L4X3T4
Tel:647-290-0000
Email: hanyon@gmail.com

Best Time To Contact:11am
Message is:
Hi,
---------------------------------------------------

<?php
$name=$_POST['name'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$contact_time=$_POST['Contact_Time'];
$address=$_POST['address'];
$city=$_POST['city'];
$postal=$_POST['postal'];
$message=$_POST['message'];
if($message=="")
{
$message="<b>no message</b>";
}
else
{
$message="<b>Message:</b><br>".$message;
}

$emailBody ="<HTML>\n"
."<head><title></title></head><body>\n"
."<table bordercolor=red border=\"1\" cellspacing=0 cellpadding=0>\n"
."<tr><td  bgcolor=\"#e9e8d6\"  colspan=2 align=center><h3>General Info Request</h3></td></tr>\n"

."<tr><td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Name:</b>$name</td>

<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b></b>$address</td>
<td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b></b>$city</td></tr>\n"
."<tr><td   bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\" colspan=2><b></b>$postal</td></tr>\n"


."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n"
."<tr><td  bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\"><b>Email:</b>$email</td>

<td   bgcolor=\"#d6d68c\" style=\"border:solid 1px #666666;\"><b>Best Time To Contact:</b>$contact_time</td></tr>\n"

."<tr><td  bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\" colspan=2>$message</td></tr>\n"
."</table></body></html>";


$emailTo =  '"" <info@land.ca>'; //Enter your email instead of email@yourdomain.com
$emailSubject = "FREE DEMONSTRATION";
$emailSubject = preg_replace('/[\x00-\x1F]/', '', $emailSubject);

$emailFrom = $email;//from email
$emailFrom = preg_replace('/[\x00-\x1F]/', '', $emailFrom);
$emailHeader = "From: $emailFrom\n"
 . "Reply-To: $emailFrom\n"
 . "Return-Path: $emailFrom\n"
 . "X-Sender: $emailFrom\n"
 . "X-Mailer: PHP\n"
 . "X-Priority: 3\n"
 . "MIME-Version: 1.0\n"
 . "Content-Type: text/html; charset=\"ISO-8859-1\"\n"
 . "Content-Transfer-Encoding: base64\n"
 . "\n";
 $emailBody=chunk_split(base64_encode($emailBody));
 
 mail($emailTo, $emailSubject, $emailBody, $emailHeader);
 # Confirmation Email to User

$confEmailTo =$email;//from email
$confEmailTo = preg_replace('/[\x00-\x1F]/', '', $confEmailTo);

$confEmailSubject = "Confirmation ";
$confEmailSubject = preg_replace('/[\x00-\x1F]/', '', $confEmailSubject);

$confEmailBody = "Hello $fname,\n"
 . "Thanks for your recent enquiry . We have received your message, we will contact you shortly - Grout Masters\n"
 . "\n"
 . "";

$confEmailHeader = "From: no-reply@yourdomain.com\n"//Enter your email instead of email@yourdomain.com
 . "Reply-To: no-reply@yourdomain.com\n"//Enter your email instead of email@yourdomain.com
 . "MIME-Version: 1.0\n"
 . "Content-type: text/plain; charset=\"ISO-8859-1\"\n"
 . "Content-transfer-encoding: 8bit\n";

mail($confEmailTo, $confEmailSubject, $confEmailBody, $confEmailHeader);

 
header("location:thankyou.html");//reload






?>

How does the phone number look now and how do you want it to look?

Just because you're printing your HTML with PHP doesn't mean this is a PHP issue...
And you can change this:

."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n"

To this:

."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b> $phone</td></tr>\n"

Added a space before $phone. Simple.

Would you be able to give me some helps on this because I am getting this message after using your code? Thanks

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\hosting\webhost4life\member\bdstock\bdstock1\marketingad2.php on line 308

Here is my page

http://www.bdstock.com/marketingad2.php

This article has been dead for over six months. Start a new discussion instead.