On 22 Mar 2007 in macromedia.dreamweaver.appdev,
RichardODreamweaver
wrote:
> I am now trying to find out where I can put my "mail"
code in the
> first form page but am having great difficulty as it is
now
> complicated by form checks and duplicate checks.
In the script which processes the form (<form
method="POST"
action="thisisthefileyouwant.php">), find where the insert
behavior
ends. Just after that, you put your code to send the email to
you.
The visitor's entered email will still be in
$_POST['emailFieldName'].
So:
<?php
// ...
// Code to insert data ends here
$to = 'me@example.com';
$subject = 'Record inserted';
$body = 'This record was inserted: EMail: ' .
$_POST['emailFieldName'];
mail($to, $subject, $body);
?>
--
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/contact.php