Hi,
Here a bit of code that I use in a members list (this is the update bit)
if (isset ($_GET['update']) OR isset ($_POST['update']))
{
$db = @mysql_connect("localhost", "username","password");
mysql_select_db("walvis",$db);
if(isset($_POST['enter']))
{
$sql="update ledenlijst set
naam='$_POST[naam]',
voornaam='$_POST[voornaam]',
straat='$_POST[straat]',
postcode='$_POST[postcode]',
woonplaats='$_POST[woonplaats]',
telefoon='$_POST[telefoon]',
mobiel='$_POST[mobiel]',
email='$_POST[email]',
brevet='$_POST[brevet]'
where id = $_POST[id]";
$result=mysql_query($sql);
print("");
$addr=$_SERVER["REMOTE_ADDR"];
$agent=$_SERVER["HTTP_USER_AGENT"];
$mailto="[EMAIL PROTECTED],$_POST[email]";
$mailsubject="Your entry was updated on the Walvis
Ledenlijst";
$mailbody="Your entry was updated new info is:\n";
$mailbody.="Voornaam: $_POST[voornaam]\n";
$mailbody.="achternaam: $_POST[naam]\n";
$mailbody.="Straat: $_POST[straat]\n";
$mailbody.="Postcode: $_POST[postcode]\n";
$mailbody.="Woonplaats: $_POST[woonplaats]\n";
$mailbody.="telefoon: $_POST[telefoon]\n";
$mailbody.="mobiel:$_POST[mobiel]\n";
$mailbody.="e-mail: $_POST[email]\n";
$mailbody.="If this was done in error please send mail
to mailto:[EMAIL PROTECTED]";
$mailbody.="Thanx!!\n";
$mailbody.="\n";
$mailbody.="\n";
$mailbody.="Changing IP address: $addr\n";
$mailbody.="Changing Browser: $agent\n";
print mail
($mailto,$mailsubject,$mailbody,"FROM:[EMAIL PROTECTED]");
}
Good Luck
Jack
-Original Message-
From: redhat [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] send email
I have created a simple form that dumps input information into a mysql
database. The person that I created it for said it would be nice if it
would also notify him by email that an entry was added to the database.
I have no idea where to begin with that - any ideas?
thanks,
DF
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php