RE: [PHP-DB] send email
You may want to loop through the form results and create the message body dynamically based on the info from the form as well. PHP's mail function is the easiest of any scripting language I've used. www.php.net/mail -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 6:46 AM To: redhat Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] send email www.php.net/mail redhat <[EMAIL PROTECTED]To: [EMAIL PROTECTED] ic.com> cc: Subject: [PHP-DB] send email 11/25/2003 08:43 AM 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] send email
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
Re: [PHP-DB] send email
www.php.net/mail redhat <[EMAIL PROTECTED]To: [EMAIL PROTECTED] ic.com> cc: Subject: [PHP-DB] send email 11/25/2003 08:43 AM 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
[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