| | |
How to make space in php contact form results?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2007
Posts: 27
Reputation:
Solved Threads: 0
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,
---------------------------------------------------
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 Syntax (Toggle Plain Text)
<?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 ?>
•
•
Join Date: Jan 2009
Posts: 49
Reputation:
Solved Threads: 7
•
•
•
•
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 Syntax (Toggle Plain Text)
<?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 ?>
Just because you're printing your HTML with PHP doesn't mean this is a PHP issue...
And you can change this:
To this:
Added a space before $phone. Simple.
And you can change this:
PHP Syntax (Toggle Plain Text)
."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n"
PHP Syntax (Toggle Plain Text)
."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b> $phone</td></tr>\n"
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
0
#4 6 Days Ago
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
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
![]() |
Similar Threads
- My VB6 Tutorial (Visual Basic 4 / 5 / 6)
- unexpected T_STRING (PHP)
Other Threads in the PHP Forum
- Previous Thread: grabbing gmail, hotmail, yahoo contacts with php
- Next Thread: printer_open() function
| Thread Tools | Search this Thread |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql startup stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend





