RE: send email

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

 



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@xxxxxxxxx,$_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@xxxxxxxxxxxx\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@xxxxxxxxxxxxx");
        }
</CODE SNIPPET>



Good Luck


Jack



-----Original Message-----
From: redhat [mailto:redhat@xxxxxxxxxxxxxxx] 
Sent: Tuesday, November 25, 2003 2:44 PM
To: php-db@xxxxxxxxxxxxx
Subject:  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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux