mail function and lots of form fields
| From: | chip dot wiegand at simrad dot com | Date: | Wed, 17 Oct 2001 22:26:21 +0000 |
| Subject: | mail function and lots of form fields | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-71413@lists.php.net to get a copy of this message | ||
I have a form with around 50 text fields. I have used the mail function to
send
forms with simple textarea's, names, and email addresses, but what about
when
I have around 50 fields to send?
I am using the following format for my mails:
<?
if(isset($submit)):
$date = date("M d, Y");
$to = "seattle.webmaster@simrad.com";
$subject = "Web Site Comments";
$body = "On $date\n $name\n ($email) wrote<br><br>" . $feedback;
mail($to, $subject, $body, "From:$email\nContent-Type: text/html;
charset=iso-8859-1\nMime-Version: 1.0\nX-Mailer: PHP/" . phpversion());
print("<h3>Thanks for the comments!</h3>\nWe appreciate you taking the
time to share your thoughts with us.");
else:
?>
The fields $feedback, $name, $email are from the form, but I have another form with around 50
fields. Is there an alternative to listing all 50or so fields on that one $body line? I'd like
the final message to have a reasonable amount of formatting to keep the many
fields sorted out and easy to read.
--
Chip Wiegand
Computer Services
www.simradusa.com
chip.wiegand@simrad.com
Simrad, Inc
Lynnwood, WA
425-712-1138
"There is no reason anyone would want a computer in their home."
--Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
(-- Then why do I have nine? Somebody help me!)