RE: [PHP-DB] send email

From: Date: Tue, 25 Nov 2003 14:06:02 +0000
Subject: RE: [PHP-DB] send email
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31740@lists.php.net to get a copy of this message
Hi, Here a bit of code that I use in a members list (this is the update bit) <CODE SNIPPET> 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("<meta http-equiv=\"refresh\" content=\"0; URL=ledenlijst.php\">"); $addr=$_SERVER["REMOTE_ADDR"]; $agent=$_SERVER["HTTP_USER_AGENT"]; $mailto="j.zanen@chello.nl,$_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:jack@vanzanen.com\n"; $mailbody.="Thanx!!\n"; $mailbody.="\n"; $mailbody.="\n"; $mailbody.="Changing IP address: $addr\n"; $mailbody.="Changing Browser: $agent\n"; print mail ($mailto,$mailsubject,$mailbody,"FROM:info@dt-walvis.com"); } </CODE SNIPPET> Good Luck Jack -----Original Message----- From: redhat [mailto:redhat@fayelectric.com] Sent: Tuesday, November 25, 2003 2:44 PM To: php-db@lists.php.net 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

« previous php.db (#31740) next »