Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-07-2012, 12:58 PM   PM User | #1
hudbarnett
New to the CF scene

 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hudbarnett is an unknown quantity at this point
PHP echo Help

Hi there

I have been using a feedback form which i found posted in these forums, it has helped me out alot as i'm new to PHP.

My question is:

When someone completes the form and presses submit, it will email the admin and also send a copy of the email to the sender.

In the email it lists all of the fields completed on the form, i would like these fields to be in a table format.

Can anyone help?

All of the code is listed on this page:

http://www.codingforums.com/showthre...=223549&page=2

Thanks in advance

Hudbarnett
hudbarnett is offline   Reply With Quote
Old 12-07-2012, 06:35 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
I think you mean, put each on separate line. Doing a table is just the same thing unless you have header you want to inclose or something else you want to add.
Anyway, in a email you use /n or /r/n instead of a <br> to force a linefeed. You want something like this:
PHP Code:
 <?php
if(isset($_POST["copy"]) && $_POST["copy"] == 1)
{
$mailTo htmlspecialchars($_POST['Email']);
$name htmlspecialchars($_POST['Name']);
$mailFrom htmlspecialchars($_POST['Email']);
$telefon htmlspecialchars($_POST['Telefon']);
$adresse htmlspecialchars($_POST['Adresse']);
$subject htmlspecialchars($_POST['Subject']);
$message_text htmlspecialchars($_POST['Message']);
$header "From: "$name " <" $mailFrom ">\r\n";
$header .= "Content-Type: text/plain; charset=\"UTF-8\"";


$message ='Navn: '.$name.' \n
E-post: '
.$mailFrom.' \n
Telefon: '
.$telefon.' \n
Adresse: '
.$adresse.' \n
Melding: '
.$message_text.' \n';

mail($mailTo$subject$message$header);
}
?>
sunfighter is offline   Reply With Quote
Old 12-07-2012, 07:22 PM   PM User | #3
davidjones1990
New Coder

 
Join Date: Sep 2011
Posts: 22
Thanks: 0
Thanked 3 Times in 3 Posts
davidjones1990 is an unknown quantity at this point
Hi,

You can use html in email view. You just need to change the content type header to text/html instead of text/plain. That was if you really want you can use a standard html table.
davidjones1990 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:46 AM.


Advertisement
Log in to turn off these ads.