Re: Newbie question about sending email

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Brown has written on 4/16/2008 4:56 PM:
On Wed, Apr 16, 2008 at 4:39 PM, Pete Holsberg <pjh42@xxxxxxxxx> wrote:
 The entire processor.php file is:

 <?php


$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

 mail("4sam-nj-subscribe@xxxxxxxxxxxxxxx,pjh42@xxxxxxxxx","SUBSCRIBE","Form
data:

 Name: " . $_POST['field_1'] . "
 Street Address: " . $_POST['field_2'] . "
 Phone Number: " . $_POST['field_3'] . "
 Email Address: " . $_POST['field_4'] . "


 powered by phpFormGenerator.
 ");

 include("confirm.html");

 ?>

    Note the mail() parameters.  There's no header information there.

    In your HTML form, add the following field (dress up the HTML as
needed to fit with your form):

<input type="text" name="from_addr">

    Then, change the email processing code to the following:

<?php

$where_form_is =
"http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/";
$to = "4sam-nj-subscribe@xxxxxxxxxxxxxxx,pjh42@xxxxxxxxx";
$subject = "SUBSCRIBE";
$from = $_POST['from_addr'];
$body = "Form data:

Name: ".$_POST['field_1']."
Email: ".$_POST['from_addr']."
Street Address: ".$_POST['field_2']."
Phone Number: ".$_POST['field_3']."
Email Address: ".$_POST['field_4']."


Why do I need both from_addr and field_4 (Email Address)? Could I just use

$from = $_POST['field_4']?

Thanks.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux